🧑 Character
Characters represents Actors which can be possessed, can move and interact with world. They are the default Skeletal Mesh Character built for nanos world.
Characters are Skeletal Meshes using Unreal's Mannequin Skeletal, with animations and interactivity already natively integrated into nanos world. It is possible to import any Skeletal Mesh (which uses Unreal's Mannequin Skeletal) to this Character.
🎒 Examples
-- The following examples are using all Skeletal Meshes which we currently have for examples, including the officials Woman, Man and Mannequin:
local woman = Character(Vector(100, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_Female")
local man = Character(Vector(200, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_Male")
local mannequin = Character(Vector(300, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_Mannequin")
local mannequin_female = Character(Vector(400, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_Mannequin_Female")
local post_apocalyptic = Character(Vector(400, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_PostApocalyptic")
local classic_male = Character(Vector(500, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_ClassicMale")
-- Adds Clothes to Man. Note: some Meshes only supports a specific Mesh (Men/Woman)
man:AddSkeletalMeshAttached("shirt", "nanos-world::SK_Shirt") -- Men only
man:AddSkeletalMeshAttached("shirt", "nanos-world::SK_Underwear") -- Men only
man:AddSkeletalMeshAttached("pants", "nanos-world::SK_Pants") -- Men only
man:AddSkeletalMeshAttached("shoes", "nanos-world::SK_Shoes_01")
man:AddSkeletalMeshAttached("tie", "nanos-world::SK_Tie")
-- Adds Clothes to Woman
woman:AddSkeletalMeshAttached("full", "nanos-world::SK_CasualSet") -- Woman only
woman:AddSkeletalMeshAttached("shoes", "nanos-world::SK_Sneakers")
-- Adds Beard to Man
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Extra", "beard")
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Middle", "beard")
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Mustache_01", "beard")
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Mustache_02", "beard")
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Side", "beard")
-- Adds Hair to Man
man:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Long", "hair_male")
man:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Short", "hair_male")
-- Adds Hair to Woman
woman:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Kwang", "hair_female")
More related examples:
Play as Propgetting-started/tutorials-and-examples/play-as-prop Nametagsgetting-started/tutorials-and-examples/name-tags Character Meshes Guideassets-modding/creating-assets/skeletal-meshes/characters-meshes🛠 Constructors
Default Constructor
local my_character = Character(location, rotation, skeletal_mesh, collision_type?, gravity_enabled?, max_health?, death_sound?, pain_sound?)
Type | Name | Default | Description |
---|---|---|---|
Vector | location | ||
Rotator | rotation | ||
SkeletalMesh Reference | skeletal_mesh | ||
CollisionType | collision_type | CollisionType.Auto | |
boolean | gravity_enabled | true | |
integer | max_health | 100 | Current / Max Health |
Sound Reference | death_sound | nanos-world::A_Male_01_Death | Played when Character dies |
Sound Reference | pain_sound | nanos-world::A_Male_01_Pain | Played when Character takes damage |
🗿 Static Functions
Inherited Entity Static Functions
Base Entityscripting-reference/classes/base-classes/Entity
Returns | Name | Description | |
---|---|---|---|
![]() | table of Base Entity | GetAll | Returns a table containing all Entities of the class this is called on |
![]() | Base Entity | GetByIndex | Returns a specific Entity of this class at an index |
![]() | integer | GetCount | Returns how many Entities of this class exist |
![]() | table of table | GetInheritedClasses | Gets a list of all directly inherited classes from this Class created with the Inheriting System |
![]() | iterator | GetPairs | Returns an iterator with all Entities of this class to be used with pairs() |
![]() | table or nil | GetParentClass | Gets the parent class if this Class was created with the Inheriting System |
![]() | table | Inherit | Inherits this class with the Inheriting System |
![]() | boolean | IsChildOf | Gets if this Class is child of another class if this Class was created with the Inheriting System |
![]() | function | Subscribe | Subscribes to an Event for all entities of this Class |
![]() | function | SubscribeRemote | Subscribes to a custom event called from server |
![]() | Unsubscribe | Unsubscribes all callbacks from this Event in this Class within this Package, or only the callback passed |
🦠 Functions
Inherited Entity Functions
Base Entityscripting-reference/classes/base-classes/Entity
Returns | Name | Description | |
---|---|---|---|
BroadcastRemoteEvent | Calls a custom remote event directly on this entity to all Players | ||
CallRemoteEvent | Calls a custom remote event directly on this entity to a specific Player | ||
CallRemoteEvent | Calls a custom remote event directly on this entity | ||
Destroy | Destroys this Entity | ||
![]() | table | GetClass | Gets the class of this entity |
![]() | integer | GetID | Gets the universal network ID of this Entity (same on both client and server) |
![]() | any | GetValue | Gets a Value stored on this Entity at the given key |
![]() | boolean | IsA | Recursively checks if this entity is inherited from a Class |
![]() | boolean | IsValid | Returns true if this Entity is valid (i.e. wasn't destroyed and points to a valid Entity) |
![]() | SetValue | Sets a Value in this Entity | |
![]() | function | Subscribe | Subscribes to an Event on this specific entity |
![]() | function | SubscribeRemote | Subscribes to a custom event called from server on this specific entity |
![]() | Unsubscribe | Unsubscribes all callbacks from this Event in this Entity within this Package, or only the callback passed |
Inherited Actor Functions
Base Actorscripting-reference/classes/base-classes/Actor
Returns | Name | Description | |
---|---|---|---|
AddActorTag | Adds an Unreal Actor Tag to this Actor | ||
![]() | AddImpulse | Applies a force in world world to this Actor | |
AttachTo | Attaches this Actor to any other Actor, optionally at a specific bone | ||
Detach | Detaches this Actor from AttachedTo Actor | ||
table of string | GetActorTags | Gets all Unreal Actor Tags on this Actor | |
![]() | table of Base Actor | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | Base Actor or nil | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | CollisionType | GetCollision | Gets this Actor's collision type |
![]() | integer | GetDimension | Gets this Actor's dimension |
float | GetDistanceFromCamera | Gets the distance of this Actor from the Camera | |
![]() | Vector | GetForce | Gets this Actor's force (set by SetForce() ) |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
Player or nil | GetNetworkAuthority | Gets this Actor's Network Authority Player | |
![]() | Vector | GetRelativeLocation | Gets this Actor's Relative Location if it's attached |
![]() | Rotator | GetRelativeRotation | Gets this Actor's Relative Rotation if it's attached |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Vector | GetScale | Gets this Actor's scale |
float | GetScreenPercentage | Gets the percentage of this Actor size in the screen | |
![]() | Vector | GetVelocity | Gets this Actor's current velocity |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
boolean | HasNetworkAuthority | Returns true if the local Player is currently the Network Authority of this Actor | |
![]() | boolean | IsBeingDestroyed | Returns true if this Actor is being destroyed |
![]() | boolean | IsGravityEnabled | Returns true if gravity is enabled on this Actor |
![]() | boolean | IsInWater | Returns true if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Returns true if this Actor is currently network distributed |
![]() | boolean | IsVisible | Returns true if this Actor is visible |
RemoveActorTag | Removes an Unreal Actor Tag from this Actor | ||
![]() | RotateTo | Smoothly rotates this actor to an angle over a certain time | |
SetCollision | Sets this Actor's collision type | ||
SetDimension | Sets this Actor's Dimension | ||
![]() | SetForce | Adds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel | |
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed. | ||
SetLocation | Sets this Actor's location in the game world | ||
SetNetworkAuthority | Sets the Player to have network authority over this Actor | ||
SetNetworkAuthorityAutoDistributed | Sets if this Actor will auto distribute the network authority between players | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetRelativeLocation | Sets this Actor's relative location in local space (only if this actor is attached) | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space (only if this actor is attached) | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetScale | Sets this Actor's scale | ||
![]() | SetVisibility | Sets whether the actor is visible or not | |
![]() | TranslateTo | Smoothly moves this actor to a location over a certain time | |
boolean | WasRecentlyRendered | Gets if this Actor was recently rendered on screen |
Inherited Paintable Functions
Base Paintablescripting-reference/classes/base-classes/Paintable
Returns | Name | Description | |
---|---|---|---|
![]() | ResetMaterial | Resets the material from the specified index to the original one | |
![]() | SetMaterial | Sets the material at the specified index of this Actor | |
![]() | SetMaterialColorParameter | Sets a Color parameter in this Actor's material | |
SetMaterialFromCanvas | Sets the material at the specified index of this Actor to a Canvas object | ||
SetMaterialFromSceneCapture | Sets the material at the specified index of this Actor to a SceneCapture object | ||
SetMaterialFromWebUI | Sets the material at the specified index of this Actor to a WebUI object | ||
![]() | SetMaterialScalarParameter | Sets a Scalar parameter in this Actor's material | |
![]() | SetMaterialTextureParameter | Sets a texture parameter in this Actor's material to an image on disk | |
![]() | SetMaterialVectorParameter | Sets a Vector parameter in this Actor's material | |
![]() | SetPhysicalMaterial | Overrides this Actor's Physical Material with a new one |
Inherited Damageable Functions
Base Damageablescripting-reference/classes/base-classes/Damageable
Returns | Name | Description | |
---|---|---|---|
integer | ApplyDamage | Do damage to this entity | |
![]() | integer | GetHealth | Gets the current health |
![]() | integer | GetMaxHealth | Gets the Max Health |
Respawn | Respawns the Entity, fullying it's Health and moving it to it's Initial Location | ||
SetHealth | Sets the Health of this Entity | ||
SetMaxHealth | Sets the MaxHealth of this Entity |
Returns | Name | Description | |
---|---|---|---|
![]() | AddSkeletalMeshAttached | Attaches a Skeletal Mesh as master pose to this entity | |
![]() | AddStaticMeshAttached | Attaches a Static Mesh to this entity | |
![]() | ClearMorphTargets | Clear all Morph Target that are set to this Mesh | |
Drop | Drops any Pickable the Character is holding | ||
EnterVehicle | Enters the Vehicle at Seat (0 - Driver) | ||
Follow | AI: Makes this Character to follow another actor | ||
table of string | GetAllMorphTargetNames | Returns a table with all morph targets available | |
![]() | table of string | GetAllSkeletalMeshAttached | Gets all Skeletal Meshes attached to this entity |
![]() | table of string | GetAllStaticMeshAttached | Gets all Static Meshes attached to this entity |
table | GetBoneTransform | Gets a Bone Transform in world space given a bone name | |
![]() | CameraMode | GetCameraMode | Gets the camera mode |
![]() | boolean | GetCanAim | Gets if can aim |
![]() | boolean | GetCanCrouch | Gets if can crouch |
![]() | boolean | GetCanDrop | Gets if can drop |
![]() | boolean | GetCanGrabProps | Gets if can grab props |
![]() | boolean | GetCanPickupPickables | Gets if can pickup Pickables (Weapons, Melee, Grenade...) |
![]() | boolean | GetCanPunch | Gets if can punch |
![]() | boolean | GetCanSprint | Gets if can sprint |
![]() | table | GetCapsuleSize | Gets the Capsule Size |
![]() | Rotator | GetControlRotation | Gets the Control Rotation |
![]() | float | GetDamageMultiplier | Gets the Damage Multiplier of a bone |
![]() | integer | GetFallDamageTaken | Gets the Fall Damage |
![]() | FallingMode | GetFallingMode | Gets the FallingMode |
![]() | boolean | GetFlyingMode | Gets if it's in Flying mode |
![]() | GaitMode | GetGaitMode | Gets the GaitMode |
![]() | Prop or nil | GetGrabbedProp | Gets the Grabbed Prop |
![]() | float | GetGravityScale | Gets the gravity scale |
![]() | integer | GetImpactDamageTaken | Gets the impact damage taken |
![]() | integer | GetJumpZVelocity | Gets the Jump Z Velocity |
![]() | SkeletalMesh Reference | GetMesh | Gets the Skeletal Mesh Asset |
![]() | float | GetMorphTarget | Returns the value of a Morph Target |
![]() | Vector | GetMovingTo | Gets the Moving To location |
![]() | Base Pickable or nil | GetPicked | Gets the Pickable if picking up |
![]() | Player or nil | GetPlayer | Gets the possessing Player |
![]() | integer | GetPunchDamage | Gets the punch damage |
![]() | float | GetSpeedMultiplier | Gets the speed multiplier |
![]() | StanceMode | GetStanceMode | Gets the Stance Mode |
![]() | SwimmingMode | GetSwimmingMode | Gets the Swimming Mode |
![]() | integer | GetTeam | Gets the Team |
![]() | Base Vehicle or nil | GetVehicle | Gets the entered Vehicle |
![]() | ViewMode | GetViewMode | Gets the View Mode |
![]() | AimMode | GetWeaponAimMode | Gets the Weapon Aim Mode |
GrabProp | Gives a Prop to the Character | ||
![]() | HideBone | Hides a bone of this Character | |
![]() | boolean | IsBoneHidden | Gets if a bone is hidden |
![]() | boolean | IsInputEnabled | Gets if has input enabled |
![]() | boolean | IsInRagdollMode | Gets if Character is in ragdoll mode |
![]() | boolean | IsInvulnerable | Gets if is invulnerable |
Jump | Triggers this Character to jump | ||
LeaveVehicle | Leaves the current Vehicle | ||
LookAt | AI: Tries to make this Character to look at Location | ||
MoveTo | AI: Makes this Character to walk to the Location | ||
PickUp | Gives a Melee/Grenade/Weapon (Pickable) to the Character | ||
PlayAnimation | Plays an Animation Montage on this character | ||
![]() | RemoveAllSkeletalMeshesAttached | Removes all SkeletalMeshes attached | |
![]() | RemoveAllStaticMeshesAttached | Removes all StaticMeshes attached | |
![]() | RemoveSkeletalMeshAttached | Removes, if it exists, a SkeletalMesh from this entity given its custom ID | |
![]() | RemoveStaticMeshAttached | Removes, if it exists, a StaticMesh from this entity given its custom ID | |
![]() | ResetPhysicalAnimationSettings | Resets all Physical Animation settings | |
SetAccelerationSettings | Sets the Movement Max Acceleration of this Character | ||
SetAnimationIdleWalkRunCrouching | Sets the Blend Space (2D) Animation for Crouching Horizontal Axis stands for Speed X and Vertical Axis for Speed Y | ||
SetAnimationIdleWalkRunProning | Sets the Blend Space (2D) Animation for Proning Horizontal Axis stands for Speed X and Vertical Axis for Speed Y | ||
SetAnimationIdleWalkRunStanding | Sets the Blend Space (2D) Animation for Standing | ||
SetAnimationsTransitionCrouchingProning | Sets the Transition Animation between Crouching and Proning | ||
SetAnimationsTransitionStandingCrouching | Sets the Transition Animation between Standing and Crouching | ||
SetBrakingSettings | Sets the Movement Braking Settings of this Character | ||
SetCameraMode | Sets the Camera Mode | ||
SetCameraOffset | Sets the Camera Offset (only affects TPS) | ||
SetCanAim | Sets if this Character is allowed to Aim | ||
SetCanCrouch | Sets if this Character is allowed to Crouch and to Prone | ||
SetCanDeployParachute | Sets if this Character is allowed to deploy the Parachute | ||
SetCanDive | Sets if this Character is allowed to Dive | ||
SetCanDrop | Sets if this Character is allowed to Drop the Picked up item | ||
SetCanGrabProps | Sets if this Character is allowed to Grab any Prop | ||
SetCanJump | Sets if this Character is allowed to Jump | ||
SetCanPickupPickables | Sets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Melee...) | ||
SetCanPunch | Sets if this Character is allowed to Punch | ||
SetCanSprint | Sets if this Character is allowed to Sprint | ||
SetCapsuleSize | Sets this Character's Capsule size | ||
SetDamageMultiplier | Changes how much damage this character takes on specific bones | ||
SetDeathSound | Changes the Death sound when Character dies | ||
SetFallDamageTaken | Set the Fall Damage multiplier taken when falling from High places | ||
SetFlyingMode | Sets the Flying Mode | ||
SetFootstepVolumeMultiplier | Set the Footstep Volume multiplier | ||
SetFOVMultiplier | Sets the Field of View multiplier | ||
SetGaitMode | Sets the Gait Mode | ||
SetGravityScale | Changes the Gravity Scale | ||
SetHighFallingTime | Sets time to transition to HighFalling state | ||
SetImpactDamageTaken | Set the Impact Damage taken when being roamed by things | ||
SetInputEnabled | Enables/Disables Character's Input | ||
SetInvulnerable | Sets if the Character can receive any damage | ||
SetJumpZVelocity | Sets the velocity of the jump | ||
SetMesh | Changes the Character Mesh on the fly | ||
![]() | SetMorphTarget | Set Morph Target with Name and Value | |
SetPainSound | Changes the Pain sound when Character takes damage | ||
SetParachuteTexture | Changes the Parachute Texture | ||
![]() | SetPhysicalAnimationSettings | Applies the physical animation settings to the body given | |
SetPunchDamage | Set the Punch Damage this Character will apply on others | ||
SetRadialDamageToRagdoll | Set the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode | ||
SetRagdollMode | Sets Character Ragdoll Mode | ||
SetSimulatePhysics | Sets the Character Capsule to simulate physics | ||
SetSpeedMultiplier | Sets all speed multiplier | ||
SetStanceMode | Sets the Stance Mode | ||
![]() | SetStaticMeshAttachedTransform | Sets a Static Mesh Attached location and rotation | |
SetTeam | Sets a Team which will disable damaging same Team Members | ||
![]() | SetViewMode | Sets the View Mode | |
![]() | SetWeaponAimMode | Sets the Weapon's Aim Mode | |
StopAnimation | Stops an Animation Montage on this character | ||
StopMovement | AI: Stops the movement | ||
UnGrabProp | UnGrabs/Drops the Prop the Character is holding | ||
![]() | UnHideBone | UnHide a bone of this Character |

AddSkeletalMeshAttached
Spawns and attaches a SkeletalMesh to this entity, the SkeletalMesh must have the same skeleton used by this Actor's mesh, and will follow all animations from it. Uses a custom ID to be used for removing/customizing it afterwards
my_character:AddSkeletalMeshAttached(id, skeletal_mesh_path, use_parent_bounds?)
Type | Parameter | Default | Description |
---|---|---|---|
string | id | Used further for removing or applying material settings on it | |
SkeletalMesh Reference | skeletal_mesh_path | Path to SkeletalMesh asset to attach | |
boolean | use_parent_bounds? | true | If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together |
See also RemoveSkeletalMeshAttached.

AddStaticMeshAttached
Spawns and attaches a StaticMesh to this entity in a Socket with a relative location and rotation. Uses a custom ID to be used for removing/customizing it afterwards
my_character:AddStaticMeshAttached(id, static_mesh_path, socket?, relative_location?, relative_rotation?, use_parent_bounds?)
Type | Parameter | Default | Description |
---|---|---|---|
string | id | Unique ID to assign to the StaticMesh | |
StaticMesh Reference | static_mesh_path | Path to StaticMesh asset to attach | |
string | socket? |
| Bone socket to attach to |
Vector | relative_location? | Vector(0, 0, 0) | Relative location |
Rotator | relative_rotation? | Rotator(0, 0, 0) | Relative rotation |
boolean | use_parent_bounds? | true | If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together |
See also SetStaticMeshAttachedTransform, RemoveStaticMeshAttached.

ClearMorphTargets
Clear all Morph Target that are set to this Mesh
my_character:ClearMorphTargets()
See also SetMorphTarget, GetMorphTarget, GetAllMorphTargetNames.

Drop
Drops any Pickable the Character is holding
my_character:Drop()

EnterVehicle
Enters the Vehicle at Seat (0 - Driver)
my_character:EnterVehicle(vehicle, seat?)
Type | Parameter | Default | Description |
---|---|---|---|
Base Vehicle | vehicle | ||
integer | seat? | 0 |
See also GetVehicle.

Follow
AI: Makes this Character to follow another actor
Triggers event MoveComplete
my_character:Follow(actor, acceptance_radius?, stop_on_succeed?, stop_on_fail?, update_rate?)
Type | Parameter | Default | Description |
---|---|---|---|
Base Actor | actor | Actor to follow | |
float | acceptance_radius? | 50 | Radius to consider success |
boolean | stop_on_succeed? | false | Whether to stop when reaching the target |
boolean | stop_on_fail? | false | Whether to stop when failed to reach the target |
float | update_rate? | 0.25 | How often to recalculate the AI path |
See also StopMovement, MoveTo, MoveComplete.

GetAllMorphTargetNames
Returns a table with all morph targets available
— Returns table of string (table with all morph targets available).
local ret = my_character:GetAllMorphTargetNames()
See also SetMorphTarget, GetMorphTarget, ClearMorphTargets.

GetAllSkeletalMeshAttached
Gets all Skeletal Meshes attached to this entity
— Returns table of string (the key as the Attached ID, and the value as the Asset Path).
local ret = my_character:GetAllSkeletalMeshAttached()

GetAllStaticMeshAttached
Gets all Static Meshes attached to this entity