๐ง 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(500, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_PostApocalyptic")
local classic_male = Character(Vector(600, 0, 100), Rotator(0, 0, 0), "nanos-world::SK_ClassicMale")
-- Adds Clothes to Man. Note: some Meshes only supports a specific Mesh (Men/Woman)
-- The first parameter is an ID: attaching again with the same ID replaces the previous mesh
man:AddSkeletalMeshAttached("shirt", "nanos-world::SK_Shirt") -- Men only (or "nanos-world::SK_Underwear")
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 a Beard to Man, other options are:
-- SM_Beard_Extra, SM_Beard_Middle, SM_Beard_Mustache_01, SM_Beard_Mustache_02 and SM_Beard_Side
man:AddStaticMeshAttached("beard", "nanos-world::SM_Beard_Middle", "beard")
-- Adds Hair to Man (or "nanos-world::SM_Hair_Long")
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โ
No description provided
local my_character = Character(location, rotation, skeletal_mesh_asset, collision_type?, gravity_enabled?, max_health?, death_sound?, pain_sound?, spawn_mode?)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector | World location to spawn at |
rotation | Rotator | World rotation to spawn with |
skeletal_mesh_asset | SkeletalMesh Reference | The Skeletal Mesh asset to use |
collision_type? | CollisionType | Collision profile of this Actor Default CollisionType.Auto |
gravity_enabled? | boolean | Whether gravity affects this Actor Default true |
max_health? | integer | Current / Max Health Default 100 |
death_sound? | Sound Reference | Played when Character dies, pass an empty string for no sound Default nanos-world::A_Male_01_Death |
pain_sound? | Sound Reference | Played when Character takes damage, pass an empty string for no sound Default nanos-world::A_Male_01_Pain |
spawn_mode? | SpawnMode | Pass SpawnMode.AfterConstructor or SpawnMode.Manual to avoid immediately sending the entity to clients and improve performance when you want to configure it by setting several configs. Must call FinishSpawn() after all Default SpawnMode.Immediate |
๐ฟ Static Functionsโ
This class doesn't have own static functions.
Inherited static functions
Subscribe, UnsubscribeSubscribeRemoteGetAll, GetByIndex, GetCount, GetPairs๐ฆ Functionsโ
| Animation | ||
PlayAnimation | Plays an Animation Montage on this character | |
SetAnimationIdleWalkRunCrouching | Sets the Blend Space (2D) Animation for Crouching | |
SetAnimationIdleWalkRunStanding | Sets the Blend Space (2D) Animation for Standing | |
SetAnimationsTransitionStandingCrouching | Sets the Transition Animation between Standing and Crouching | |
| Appearance | ||
SetMesh | Changes the Character Mesh at runtime | |
SetParachuteTexture | Changes the texture of the Character's parachute | |
| Audio | ||
GetFootstepVolumeMultiplier: float | Gets the Footstep Volume multiplier | |
SetDeathSound | Changes the Death sound when Character dies | |
SetFootstepVolumeMultiplier | Set the Footstep Volume multiplier | |
SetPainSound | Changes the Pain sound when Character takes damage | |
| Camera | ||
GetCameraMode: CameraMode | Gets the camera mode | |
GetViewMode: ViewMode | Gets the View Mode | |
SetCameraMode | Sets the Camera Mode | |
SetFOVMultiplier | Sets the Field of View multiplier | |
SetViewMode | Sets the View Mode (first person, third person or top down) | |
| Combat | ||
GetCanAim: boolean | Gets if this Character is allowed to aim | |
GetCanPunch: boolean | Gets if this Character is allowed to punch | |
GetFallDamageTaken: integer | Gets the Fall Damage multiplier | |
GetImpactDamageTaken: integer | Gets the Impact Damage taken when being run over | |
GetPunchDamage: integer | Gets the damage dealt by this Character's punches | |
GetWeaponAimMode: AimMode | Gets the Weapon Aim Mode | |
GetWeaponShooterMode: boolean | Gets if this Character is in Shooter Mode | |
IsInvulnerable: boolean | Gets if this Character is invulnerable | |
SetCanAim | Sets if this Character is allowed to Aim | |
SetCanPunch | Sets if this Character is allowed to Punch | |
SetFallDamageTaken | Set the Fall Damage multiplier taken when falling from High places | |
SetImpactDamageTaken | Set the Impact Damage taken when being run over by things | |
SetInvulnerable | Sets if the Character can receive any damage | |
SetPunchDamage | Set the Punch Damage this Character will apply on others | |
SetWeaponAimMode | Sets the Weapon's Aim Mode | |
SetWeaponShooterMode | Sets if this Character is in Shooter Mode, in which a held Weapon is always aimed while idle or walking, is lowered while sprinting, and the aim input aims down sights instead of raising the Weapon | |
| Interaction | ||
Drop | Drops any Pickable the Character is holding | |
EnterVehicle | Enters the Vehicle at Seat (0 - Driver) | |
GetCanDrop: boolean | Gets if this Character is allowed to drop the picked up item | |
GetCanGrabProps: boolean | Gets if this Character is allowed to grab Props | |
GetCanPickupPickables: boolean | Gets if this Character is allowed to pick up Pickables (Weapon, Grenade, Melee...) | |
GetCanUsePickables: boolean | Gets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...) | |
GetGrabbedProp: Prop or nil | Gets the Grabbed Prop | |
GetPicked: Base Pickable or nil | Gets the Pickable if picking up | |
GetVehicle: Base Vehicle or nil | Gets the entered Vehicle | |
GetVehicleSeat: integer | Gets the entered Vehicle seat | |
GrabProp | Gives a Prop to the Character | |
IsInputEnabled: boolean | Gets if this Character has input enabled | |
LeaveVehicle | Leaves the current Vehicle | |
PickUp | Gives a Melee/Grenade/Weapon (Pickable) to the Character | |
SetCanDrop | Sets if this Character is allowed to Drop the Picked up item | |
SetCanGrabProps | Sets if this Character is allowed to Grab any Prop | |
SetCanPickupPickables | Sets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Melee...) | |
SetCanUsePickables | Sets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...) | |
SetInputEnabled | Enables/Disables Character's Input | |
UnGrabProp | UnGrabs/Drops the Prop the Character is holding | |
| Movement | ||
GetCanDeployParachute: boolean | Gets if this Character is allowed to deploy the Parachute | |
GetCanDive: boolean | Gets if this Character is allowed to Dive | |
GetCanSprint: boolean | Gets if this Character is allowed to sprint | |
GetFallingMode: FallingMode | Gets the current Falling Mode | |
GetGaitMode: GaitMode | Gets the current Gait Mode | |
GetSpeedMultiplier: float | Gets the movement speed multiplier | |
GetStanceMode: StanceMode | Gets the Stance Mode | |
GetSwimmingMode: SwimmingMode | Gets the Swimming Mode | |
LookAt | AI: Tries to make this Character to look at Location | |
SetAccelerationSettings | Sets the Movement Max Acceleration of this Character | |
SetAirControl | Sets the amount of movement control allowed when it is in air | |
SetCanDeployParachute | Sets if this Character is allowed to deploy the Parachute | |
SetCanDive | Sets if this Character is allowed to Dive | |
SetCanSprint | Sets if this Character is allowed to Sprint | |
SetGaitMode | Sets the Gait Mode (walking or sprinting) | |
SetHighFallingTime | Sets time to transition to HighFalling state | |
SetSpeedMultiplier | Sets the multiplier applied to all movement speeds | |
SetStanceMode | Sets the Stance Mode (standing or crouching) | |
| Physics | ||
GetRadialDamageToRagdoll: integer | Gets the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode | |
IsInRagdollMode: boolean | Gets if Character is in ragdoll mode | |
ResetPhysicalAnimationSettings | Resets all Physical Animation settings | |
SetPhysicalAnimationSettings | Applies the physical animation settings to the body given | |
SetPhysicsAsset | Sets the Physics Asset for the Character | |
SetRadialDamageToRagdoll | Set the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode | |
SetRagdollMode | Enables or disables the Ragdoll Mode, making the Character fall as a physics body | |
SetRagdollOnHitEnabled | Sets if the character will enter ragdoll mode when being hit by an object or falling from a high place | |
SetRagdollStandUpCooldown | Sets the cooldown time (in seconds) before this Character can stand up from ragdoll | |
SetSimulatePhysics | Sets the Character Capsule to simulate physics | |
Inherited functions
ClearMorphTargets, GetAllMorphTargetNames, GetMesh, GetMorphTarget, HideBone, IsBoneHidden, SetMeshSettings, SetMorphTarget, UnHideBoneAddSkeletalMeshAttached, AddStaticMeshAttached, GetAllSkeletalMeshAttached, GetAllStaticMeshAttached, RemoveAllSkeletalMeshesAttached, RemoveAllStaticMeshesAttached, RemoveSkeletalMeshAttached, RemoveStaticMeshAttached, SetStaticMeshAttachedTransformApplyDamage, GetDamageMultiplier, GetHealth, GetMaxHealth, IsDead, Respawn, SetDamageMultiplier, SetHealth, SetMaxHealthGetMaterialColorParameter, GetMaterialScalarParameter, GetMaterialTextureParameter, GetMaterialVectorParameter, ResetMaterial, SetMaterial, SetMaterialColorParameter, SetMaterialFromCanvas, SetMaterialFromSceneCapture, SetMaterialFromWebUI, SetMaterialScalarParameter, SetMaterialTextureParameter, SetMaterialVectorParameter, SetPhysicalMaterialGetDistanceFromCamera, GetScreenPercentage, IsVisible, SetCastShadow, SetHighlightEnabled, SetOutlineEnabled, SetRenderCullDistance, SetVisibility, WasRecentlyRenderedAttachTo, Detach, GetAttachedEntities, GetAttachedTo, GetAttachedToSocket, GetSocketTransformGetLifeSpan, SetLifeSpanGetDimension, GetNetworkAuthority, HasNetworkAuthority, IsNetworkDistributed, SetDimension, SetDistanceOptimizationMultiplier, SetNetworkAuthority, SetNetworkAuthorityAutoDistributedGetAllValuesKeys, GetValue, SetValueSubscribe, UnsubscribeDestroy, FinishSpawn, IsBeingDestroyed, IsSpawned, IsValid, SetSpawnModeBroadcastRemoteEvent, BroadcastRemoteInRadiusEvent, CallRemoteEvent, CallRemoteEvent, CallRemotePlayersEvent, HasAuthority, SubscribeRemoteGetIDAnimationfunctionsโ

PlayAnimationSlowโ
Plays an Animation Montage on this character
my_character:PlayAnimation(animation_path, slot_type?, loop_indefinitely?, blend_in_time?, blend_out_time?, play_rate?, stop_all_montages?)
Parameters
| Name | Type | Description |
|---|---|---|
animation_path | Animation Reference | The Animation asset to play |
slot_type? | AnimationSlotType | Which part of the body plays the animation Default AnimationSlotType.FullBody |
loop_indefinitely? | boolean | Whether to keep looping until stopped Default false |
blend_in_time? | float | Seconds to blend into the animation Default 0.25 |
blend_out_time? | float | Pass it -1 to disable auto blend out and keep the animation running in last pose forever Default 0.25 |
play_rate? | float | Speed multiplier of the animation Default 1.0 |
stop_all_montages? | boolean | Stops all running Montages from the same Group Default false |
See also StopAnimation.

SetAnimationIdleWalkRunCrouchingSlowโ
Sets the Blend Space (2D) Animation for Crouching
Horizontal Axis stands for Speed X and Vertical Axis for Speed Y
my_character:SetAnimationIdleWalkRunCrouching(blend_space_path, enable_turn_in_place?)
Parameters
| Name | Type | Description |
|---|---|---|
blend_space_path | Animation Reference | The Blend Space (2D) asset |
enable_turn_in_place? | boolean | Whether the Character plays turn-in-place animations when rotating while idle Default false |

SetAnimationIdleWalkRunStandingSlowโ
Sets the Blend Space (2D) Animation for Standing
Horizontal Axis stands for Speed X and Vertical Axis for Speed Y
my_character:SetAnimationIdleWalkRunStanding(blend_space_path, enable_turn_in_place?)
Parameters
| Name | Type | Description |
|---|---|---|
blend_space_path | Animation Reference | The Blend Space (2D) asset |
enable_turn_in_place? | boolean | Whether the Character plays turn-in-place animations when rotating while idle Default false |

SetAnimationsTransitionStandingCrouchingSlowโ
Sets the Transition Animation between Standing and Crouching
my_character:SetAnimationsTransitionStandingCrouching(standing_to_crouching, crouching_to_standing)
Parameters
| Name | Type | Description |
|---|---|---|
standing_to_crouching | Animation Reference | Animation played when crouching |
crouching_to_standing | Animation Reference | Animation played when standing up |
Appearancefunctionsโ

SetMeshSlowโ
Changes the Character Mesh at runtime
my_character:SetMesh(skeletal_mesh_asset)
Parameters
| Name | Type | Description |
|---|---|---|
skeletal_mesh_asset | SkeletalMesh Reference | The new Skeletal Mesh asset |

SetParachuteTextureSlowโ
Changes the texture of the Character's parachute
my_character:SetParachuteTexture(texture?)
Parameters
| Name | Type | Description |
|---|---|---|
texture? | Image Path | The new Parachute Texture, pass nil or an empty string to restore the default Texture Default nil |
Audiofunctionsโ

GetFootstepVolumeMultiplierOptimalโ
Gets the Footstep Volume multiplier
local volume_multiplier = my_character:GetFootstepVolumeMultiplier()
Returns
| Type | Description |
|---|---|
| float | Footstep Volume multiplier |
See also SetFootstepVolumeMultiplier.

SetDeathSoundSlowโ
Changes the Death sound when Character dies
my_character:SetDeathSound(sound_asset?)
Parameters
| Name | Type | Description |
|---|---|---|
sound_asset? | Sound Reference | The new Death sound when Character dies, pass nil or an empty string for no sound Default nil |

SetFootstepVolumeMultiplierOptimalโ
Set the Footstep Volume multiplier
my_character:SetFootstepVolumeMultiplier(volume_multiplier)
Parameters
| Name | Type | Description |
|---|---|---|
volume_multiplier | float | The new Footstep Volume multiplier |
See also GetFootstepVolumeMultiplier.

SetPainSoundSlowโ
Changes the Pain sound when Character takes damage
my_character:SetPainSound(sound_asset?)
Parameters
| Name | Type | Description |
|---|---|---|
sound_asset? | Sound Reference | The new Pain sound when Character takes damage, pass nil or an empty string for no sound Default nil |
Camerafunctionsโ

GetCameraModeOptimalโ
Gets the camera mode
local camera_mode = my_character:GetCameraMode()
Returns
| Type | Description |
|---|---|
| CameraMode | Camera mode |
See also SetCameraMode.

GetViewModeOptimalโ
Gets the View Mode
local view_mode = my_character:GetViewMode()
Returns
| Type | Description |
|---|---|
| ViewMode | View Mode |
See also SetViewMode.

SetCameraModeOptimalโ
Sets the Camera Mode
It can allow only TPS, only FPS or both.
Using FPSOnly CameraMode on AI will lock his body rotation (when using LookAt)
my_character:SetCameraMode(camera_mode)
Parameters
| Name | Type | Description |
|---|---|---|
camera_mode | CameraMode | The new Camera Mode |
See also GetCameraMode.

SetFOVMultiplierOptimalโ
Sets the Field of View multiplier
my_character:SetFOVMultiplier(multiplier)
Parameters
| Name | Type | Description |
|---|---|---|
multiplier | float | The new Field of View multiplier |

SetViewModeOptimalโ
Sets the View Mode (first person, third person or top down)
my_character:SetViewMode(view_mode)
Parameters
| Name | Type | Description |
|---|---|---|
view_mode | ViewMode | The new View Mode |
See also GetViewMode.
Combatfunctionsโ

GetCanAimOptimalโ
Gets if this Character is allowed to aim
local can_aim = my_character:GetCanAim()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to aim |
See also SetCanAim.

GetCanPunchOptimalโ
Gets if this Character is allowed to punch
local can_punch = my_character:GetCanPunch()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to punch |
See also SetCanPunch.

GetFallDamageTakenOptimalโ
Gets the Fall Damage multiplier
local damage = my_character:GetFallDamageTaken()
Returns
| Type | Description |
|---|---|
| integer | The Fall Damage multiplier |
See also SetFallDamageTaken.

GetImpactDamageTakenOptimalโ
Gets the Impact Damage taken when being run over
local impact_damage = my_character:GetImpactDamageTaken()
Returns
| Type | Description |
|---|---|
| integer | The Impact Damage |
See also SetImpactDamageTaken.

GetPunchDamageOptimalโ
Gets the damage dealt by this Character's punches
local punch_damage = my_character:GetPunchDamage()
Returns
| Type | Description |
|---|---|
| integer | The punch damage |
See also SetPunchDamage.

GetWeaponAimModeOptimalโ
Gets the Weapon Aim Mode
local aim_mode = my_character:GetWeaponAimMode()
Returns
| Type | Description |
|---|---|
| AimMode | Weapon Aim Mode |
See also SetWeaponAimMode.

GetWeaponShooterModeOptimalโ
Gets if this Character is in Shooter Mode
local weapon_shooter_mode = my_character:GetWeaponShooterMode()
Returns
| Type | Description |
|---|---|
| boolean | Whether this Character is in Shooter Mode |
See also SetWeaponShooterMode.

IsInvulnerableOptimalโ
Gets if this Character is invulnerable
local is_invulnerable = my_character:IsInvulnerable()
Returns
| Type | Description |
|---|---|
| boolean | Whether this Character is invulnerable |
See also SetInvulnerable.

SetCanAimOptimalโ
Sets if this Character is allowed to Aim
my_character:SetCanAim(can_aim)
Parameters
| Name | Type | Description |
|---|---|---|
can_aim | boolean | Whether this Character is allowed to Aim |
See also GetCanAim.

SetCanPunchOptimalโ
Sets if this Character is allowed to Punch
my_character:SetCanPunch(can_punch)
Parameters
| Name | Type | Description |
|---|---|---|
can_punch | boolean | Whether this Character is allowed to Punch |
See also GetCanPunch.

SetFallDamageTakenOptimalโ
Set the Fall Damage multiplier taken when falling from High places
Setting to 0 will make the Character not take any damage
my_character:SetFallDamageTaken(damage)
Parameters
| Name | Type | Description |
|---|---|---|
damage | integer | Default is 10 |
See also GetFallDamageTaken.

SetImpactDamageTakenOptimalโ
Set the Impact Damage taken when being run over by things
Setting to 0 will make the Character not take damage or enter ragdoll mode
my_character:SetImpactDamageTaken(impact_damage)
Parameters
| Name | Type | Description |
|---|---|---|
impact_damage | integer | Default is 10 |
See also SetRagdollOnHitEnabled, GetImpactDamageTaken.

SetInvulnerableOptimalโ
Sets if the Character can receive any damage
my_character:SetInvulnerable(is_invulnerable)
Parameters
| Name | Type | Description |
|---|---|---|
is_invulnerable | boolean | Whether the Character can receive any damage |
See also IsInvulnerable.

SetPunchDamageOptimalโ
Set the Punch Damage this Character will apply on others
my_character:SetPunchDamage(punch_damage)
Parameters
| Name | Type | Description |
|---|---|---|
punch_damage | integer | Default is 15 |
See also GetPunchDamage.

SetWeaponAimModeModerateโ
Sets the Weapon's Aim Mode
my_character:SetWeaponAimMode(aim_mode)
Parameters
| Name | Type | Description |
|---|---|---|
aim_mode | AimMode | The new Weapon's Aim Mode |
See also GetWeaponAimMode.

SetWeaponShooterModeOptimalโ
Sets if this Character is in Shooter Mode, in which a held Weapon is always aimed while idle or walking, is lowered while sprinting, and the aim input aims down sights instead of raising the Weapon
my_character:SetWeaponShooterMode(weapon_shooter_mode)
Parameters
| Name | Type | Description |
|---|---|---|
weapon_shooter_mode | boolean | Whether this Character is in Shooter Mode, in which a held Weapon is always aimed while idle or walking, is lowered while sprinting, and the aim input aims down sights instead of raising the Weapon |
See also GetWeaponShooterMode.
Interactionfunctionsโ

EnterVehicleModerateโ
Enters the Vehicle at Seat (0 - Driver)
my_character:EnterVehicle(vehicle, seat?)
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Base Vehicle | The Vehicle |
seat? | integer | Seat index to enter, 0 is the driver seat Default 0 |
See also GetVehicle, GetVehicleSeat, EnterVehicle, AttemptEnterVehicle.

GetCanDropOptimalโ
Gets if this Character is allowed to drop the picked up item
local can_drop = my_character:GetCanDrop()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to drop |
See also SetCanDrop.

GetCanGrabPropsOptimalโ
Gets if this Character is allowed to grab Props
local can_grab_props = my_character:GetCanGrabProps()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to grab Props |
See also SetCanGrabProps.

GetCanPickupPickablesOptimalโ
Gets if this Character is allowed to pick up Pickables (Weapon, Grenade, Melee...)
local can_pickup = my_character:GetCanPickupPickables()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to pick up Pickables |
See also SetCanPickupPickables.

GetCanUsePickablesOptimalโ
Gets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...)
local can_use = my_character:GetCanUsePickables()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to use Pickables |
See also SetCanUsePickables.

GetGrabbedPropOptimalโ
Gets the Grabbed Prop
local prop = my_character:GetGrabbedProp()
See also GrabProp, UnGrabProp.

GetPickedOptimalโ
Gets the Pickable if picking up
local object = my_character:GetPicked()
Returns
| Type | Description |
|---|---|
| Base Pickable or nil | Pickable if picking up |

GetVehicleOptimalโ
Gets the entered Vehicle
local vehicle = my_character:GetVehicle()
Returns
| Type | Description |
|---|---|
| Base Vehicle or nil | Entered Vehicle |
See also EnterVehicle, LeaveVehicle.

GetVehicleSeatOptimalโ
Gets the entered Vehicle seat
local seat_index = my_character:GetVehicleSeat()
Returns
| Type | Description |
|---|---|
| integer | The seat index the Character is sitting in the Vehicle. -1 if not in a Vehicle |

GrabPropModerateโ
Gives a Prop to the Character
my_character:GrabProp(prop)
Parameters
| Name | Type | Description |
|---|---|---|
prop | Prop | The Prop |
See also GetGrabbedProp.

IsInputEnabledOptimalโ
Gets if this Character has input enabled
local is_enabled = my_character:IsInputEnabled()
Returns
| Type | Description |
|---|---|
| boolean | Whether input is enabled |
See also SetInputEnabled.

LeaveVehicleModerateโ
Leaves the current Vehicle
my_character:LeaveVehicle()
See also EnterVehicle, GetVehicle, LeaveVehicle, AttemptLeaveVehicle.

PickUpModerateโ
Gives a Melee/Grenade/Weapon (Pickable) to the Character
my_character:PickUp(pickable)
Parameters
| Name | Type | Description |
|---|---|---|
pickable | Base Pickable | The Weapon, Melee or Grenade to give to this Character |

SetCanDropOptimalโ
Sets if this Character is allowed to Drop the Picked up item
my_character:SetCanDrop(can_drop)
Parameters
| Name | Type | Description |
|---|---|---|
can_drop | boolean | Whether this Character is allowed to Drop the Picked up item |
See also GetCanDrop.

SetCanGrabPropsOptimalโ
Sets if this Character is allowed to Grab any Prop
my_character:SetCanGrabProps(can_grab_props)
Parameters
| Name | Type | Description |
|---|---|---|
can_grab_props | boolean | Whether this Character is allowed to Grab any Prop |
See also GetCanGrabProps.

SetCanPickupPickablesOptimalโ
Sets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Melee...)
my_character:SetCanPickupPickables(can_pickup)
Parameters
| Name | Type | Description |
|---|---|---|
can_pickup | boolean | Whether this Character is allowed to Pick up any Pickable |
See also GetCanPickupPickables.

SetCanUsePickablesOptimalโ
Sets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...)
my_character:SetCanUsePickables(can_use)
Parameters
| Name | Type | Description |
|---|---|---|
can_use | boolean | Whether this Character is allowed to use Pickables |
See also GetCanUsePickables.

SetInputEnabledOptimalโ
Enables/Disables Character's Input
my_character:SetInputEnabled(is_enabled)
Parameters
| Name | Type | Description |
|---|---|---|
is_enabled | boolean | Whether to enable Character's Input |
See also IsInputEnabled.
Movementfunctionsโ

GetCanDeployParachuteOptimalโ
Gets if this Character is allowed to deploy the Parachute
local can_deploy_parachute = my_character:GetCanDeployParachute()
Returns
| Type | Description |
|---|---|
| boolean | Whether this Character is allowed to deploy the Parachute |
See also SetCanDeployParachute.

GetCanDiveOptimalโ
Gets if this Character is allowed to Dive
local can_dive = my_character:GetCanDive()
Returns
| Type | Description |
|---|---|
| boolean | Whether this Character is allowed to Dive |
See also SetCanDive.

GetCanSprintOptimalโ
Gets if this Character is allowed to sprint
local can_sprint = my_character:GetCanSprint()
Returns
| Type | Description |
|---|---|
| boolean | Whether it is allowed to sprint |
See also SetCanSprint.

GetFallingModeOptimalโ
Gets the current Falling Mode
local ret = my_character:GetFallingMode()
Returns
| Type | Description |
|---|---|
| FallingMode | The current Falling Mode |

GetGaitModeOptimalโ
Gets the current Gait Mode
local gait_mode = my_character:GetGaitMode()
Returns
| Type | Description |
|---|---|
| GaitMode | The current Gait Mode |
See also SetGaitMode.

GetSpeedMultiplierOptimalโ
Gets the movement speed multiplier
local speed_multiplier = my_character:GetSpeedMultiplier()
Returns
| Type | Description |
|---|---|
| float | The speed multiplier |
See also SetSpeedMultiplier.

GetStanceModeOptimalโ
Gets the Stance Mode
local stance_mode = my_character:GetStanceMode()
Returns
| Type | Description |
|---|---|
| StanceMode | Stance Mode |
See also SetStanceMode.

GetSwimmingModeOptimalโ
Gets the Swimming Mode
local swimming_mode = my_character:GetSwimmingMode()
Returns
| Type | Description |
|---|---|
| SwimmingMode | Swimming Mode |

LookAtModerateโ
AI: Tries to make this Character to look at Location
my_character:LookAt(location)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector | World location to look |

SetAccelerationSettingsOptimalโ
Sets the Movement Max Acceleration of this Character
my_character:SetAccelerationSettings(walking?, parachuting?, skydiving?, falling?, swimming?, swimming_surface?, flying?)
Parameters
| Name | Type | Description |
|---|---|---|
walking? | integer | Max acceleration while walking Default 768 |
parachuting? | integer | Max acceleration while parachuting Default 512 |
skydiving? | integer | Max acceleration while skydiving Default 768 |
falling? | integer | Max air control acceleration while falling Default 128 |
swimming? | integer | Max acceleration while swimming underwater Default 256 |
swimming_surface? | integer | Max acceleration while swimming on the surface Default 256 |
flying? | integer | Max acceleration while flying Default 1024 |

SetAirControlOptimalโ
Sets the amount of movement control allowed when it is in air
my_character:SetAirControl(air_control?, boost_multiplier?, boost_velocity_threshold?)
Parameters
| Name | Type | Description |
|---|---|---|
air_control? | float | When falling, amount of lateral movement control available to the character. 0 = no control, 1 = full control at max speed of MaxWalkSpeed Default 0.2 |
boost_multiplier? | float | When falling, multiplier applied to air_control when lateral velocity is less than boost_velocity_threshold. Setting this to zero will disable air control boosting. Final result is clamped at 1 Default 512 |
boost_velocity_threshold? | float | When falling, if lateral velocity magnitude is less than this value, air_control is multiplied by boost_multiplier. Setting this to zero will disable air control boosting Default 25 |

SetCanDeployParachuteOptimalโ
Sets if this Character is allowed to deploy the Parachute
my_character:SetCanDeployParachute(can_deploy_parachute)
Parameters
| Name | Type | Description |
|---|---|---|
can_deploy_parachute | boolean | Whether this Character is allowed to deploy the Parachute |
See also GetCanDeployParachute.

SetCanDiveOptimalโ
Sets if this Character is allowed to Dive
my_character:SetCanDive(can_dive)
Parameters
| Name | Type | Description |
|---|---|---|
can_dive | boolean | Whether this Character is allowed to Dive |
See also GetCanDive.

SetCanSprintOptimalโ
Sets if this Character is allowed to Sprint
my_character:SetCanSprint(can_sprint)
Parameters
| Name | Type | Description |
|---|---|---|
can_sprint | boolean | Whether this Character is allowed to Sprint |
See also GetCanSprint.

SetGaitModeOptimalโ
Sets the Gait Mode (walking or sprinting)
my_character:SetGaitMode(gait_mode)
Parameters
| Name | Type | Description |
|---|---|---|
gait_mode | GaitMode | The new Gait Mode |
See also GetGaitMode.

SetHighFallingTimeOptimalโ
Sets time to transition to HighFalling state
Sets time elapsed until automatically transition to HighFalling state (from SmallFalling) in seconds
Set it to -1 to never enter HighFalling time and consequently do not ragdoll when falling
my_character:SetHighFallingTime(time)
Parameters
| Name | Type | Description |
|---|---|---|
time | float | Default is 1 second |
See also SetRagdollOnHitEnabled.

SetSpeedMultiplierOptimalโ
Sets the multiplier applied to all movement speeds
my_character:SetSpeedMultiplier(speed_multiplier)
Parameters
| Name | Type | Description |
|---|---|---|
speed_multiplier | float | 1 is normal |
See also GetSpeedMultiplier.

SetStanceModeOptimalโ
Sets the Stance Mode (standing or crouching)
my_character:SetStanceMode(stance_mode)
Parameters
| Name | Type | Description |
|---|---|---|
stance_mode | StanceMode | The new Stance Mode |
See also GetStanceMode.
Physicsfunctionsโ

GetRadialDamageToRagdollOptimalโ
Gets the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode
local damage = my_character:GetRadialDamageToRagdoll()
Returns
| Type | Description |
|---|---|
| integer | -1 if the Character never enters ragdoll mode from radial damage |
See also SetRadialDamageToRagdoll.

IsInRagdollModeOptimalโ
Gets if Character is in ragdoll mode
local ragdoll_enabled = my_character:IsInRagdollMode()
Returns
| Type | Description |
|---|---|
| boolean | Whether Character is in ragdoll mode |

ResetPhysicalAnimationSettingsModerateโ
Resets all Physical Animation settings
my_character:ResetPhysicalAnimationSettings()

SetPhysicalAnimationSettingsModerateโ
Applies the physical animation settings to the body given
my_character:SetPhysicalAnimationSettings(bone, include_self, is_local_simulation, orientation_strength?, angular_velocity_strength?, position_strength?, velocity_strength?, max_linear_force?, max_angular_force?)
Parameters
| Name | Type | Description |
|---|---|---|
bone | string | The body we will be driving |
include_self | boolean | Whether to modify the given body |
is_local_simulation | boolean | Whether the drive targets are in world space or local |
orientation_strength? | float | The strength used to correct orientation error Default 0 |
angular_velocity_strength? | float | The strength used to correct angular velocity error Default 0 |
position_strength? | float | The strength used to correct linear position error. Only used for non-local simulation Default 0 |
velocity_strength? | float | The strength used to correct linear velocity error. Only used for non-local simulation Default 0 |
max_linear_force? | float | The max force used to correct linear errors Default 0 |
max_angular_force? | float | The max force used to correct angular errors Default 0 |

SetPhysicsAssetSlowโ
Sets the Physics Asset for the Character
my_character:SetPhysicsAsset(physics_asset?)
Parameters
| Name | Type | Description |
|---|---|---|
physics_asset? | Other Asset Reference | The new Physics Asset for the Character, pass nil or an empty string to restore the Mesh's own Physics Asset Default nil |

SetRadialDamageToRagdollOptimalโ
Set the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode
Set the minimum radial damage taken (e.g. explosions) to enter in ragdoll mode.
Setting to -1 will make the Character never enter ragdoll mode when getting radial damage
my_character:SetRadialDamageToRagdoll(damage)
Parameters
| Name | Type | Description |
|---|---|---|
damage | integer | Default is 50 |
See also GetRadialDamageToRagdoll.

SetRagdollModeOptimalโ
Enables or disables the Ragdoll Mode, making the Character fall as a physics body
my_character:SetRagdollMode(ragdoll_enabled)
Parameters
| Name | Type | Description |
|---|---|---|
ragdoll_enabled | boolean | Whether the Ragdoll Mode is enabled |

SetRagdollOnHitEnabledOptimalโ
Sets if the character will enter ragdoll mode when being hit by an object or falling from a high place
my_character:SetRagdollOnHitEnabled(is_enabled)
Parameters
| Name | Type | Description |
|---|---|---|
is_enabled | boolean | Whether the character will enter ragdoll mode when being hit by an object or falling from a high place |
See also SetHighFallingTime.

SetRagdollStandUpCooldownOptimalโ
Sets the cooldown time (in seconds) before this Character can stand up from ragdoll
my_character:SetRagdollStandUpCooldown(time)
Parameters
| Name | Type | Description |
|---|---|---|
time | float | The new cooldown time (in seconds) before this Character can stand up from ragdoll |

SetSimulatePhysicsOptimalโ
Sets the Character Capsule to simulate physics
my_character:SetSimulatePhysics(simulate_physics)
Parameters
| Name | Type | Description |
|---|---|---|
simulate_physics | boolean | The new Character Capsule to simulate physics |
๐ Eventsโ
Attack | Triggered when the Character effectively attacks with a Melee | |
AttemptEnterVehicle | Triggered when a Character attempts to enter a vehicle | |
AttemptLeaveVehicle | Triggered when this Character attempts to leave a vehicle | |
AttemptReload | Triggered when this Character attempts to reload | |
Drop | When Character drops the currently picked up Pickable | |
EnterVehicle | When Character enters a vehicle | |
FallingModeChange | Called when FallingMode changes | |
Fire | When Character fires a Weapon | |
GaitModeChange | Called when GaitMode changes | |
GrabProp | When Character grabs up a Prop | |
Highlight | When Character highlights/looks at a Prop or a Pickable | |
Interact | Triggered when a Character interacts with a Prop or Pickable | |
LeaveVehicle | When Character leaves a vehicle | |
PickUp | When Character picks up anything | |
PullUse | Triggered when a Character presses the use button for a Pickable (i.e. clicks left mouse button with this equipped) | |
Punch | When Character punches | |
RagdollModeChange | When Character enters or leaves ragdoll | |
ReleaseUse | Triggered when a Character releases the use button for a Pickable (i.e. releases left mouse button with this equipped) | |
Reload | When Character reloads a weapon | |
StanceModeChange | Called when StanceMode changes | |
SwimmingModeChange | Called when Swimming Mode changes | |
UnGrabProp | When Character drops a Prop | |
ViewModeChange | When Character changes its View Mode | |
WeaponAimModeChange | Called when Weapon Aim Mode changes |
Inherited events
AnimationBeginNotify, AnimationEndNotify, MoveComplete, Possess, UnPossessDeath, HealthChange, Respawn, TakeDamageClassRegister, Destroy, Spawn, ValueChange
Attackโ
Triggered when the Character effectively attacks with a Melee
Character.Subscribe("Attack", function(self, melee)
-- Attack was called
end)

AttemptEnterVehicleโ
Triggered when a Character attempts to enter a vehicle
Character.Subscribe("AttemptEnterVehicle", function(self, vehicle, seat_index)
-- AttemptEnterVehicle was called
return true
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
vehicle | Base Vehicle | The Vehicle |
seat_index | integer | The seat it is trying to enter, 0 is the driver seat |
Returns
| Type | Description |
|---|---|
| boolean | Return false to prevent it |
See also GetVehicle, EnterVehicle, EnterVehicle.

AttemptLeaveVehicleโ
Triggered when this Character attempts to leave a vehicle
Character.Subscribe("AttemptLeaveVehicle", function(self, vehicle)
-- AttemptLeaveVehicle was called
return true
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
vehicle | Base Vehicle | The Vehicle |
Returns
| Type | Description |
|---|---|
| boolean | Return false to prevent it |
See also LeaveVehicle, LeaveVehicle.

AttemptReloadโ
Triggered when this Character attempts to reload
Character.Subscribe("AttemptReload", function(self, weapon)
-- AttemptReload was called
return true
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
weapon | Weapon | The Weapon |
Returns
| Type | Description |
|---|---|
| boolean | Return false to prevent it |

Dropโ
When Character drops the currently picked up Pickable
Character.Subscribe("Drop", function(self, object, triggered_by_player)
-- Drop was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
object | Base Pickable | The Pickable being dropped |
triggered_by_player | boolean | Whether the Player dropped it by input, instead of by scripting |

EnterVehicleโ
When Character enters a vehicle
Character.Subscribe("EnterVehicle", function(self, vehicle, seat_index)
-- EnterVehicle was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
vehicle | Base Vehicle | The Vehicle |
seat_index | integer | The seat entered, 0 is the driver seat |
See also GetVehicle, EnterVehicle, AttemptEnterVehicle.

FallingModeChangeโ
Called when FallingMode changes
Character.Subscribe("FallingModeChange", function(self, old_state, new_state)
-- FallingModeChange was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
old_state | FallingMode | The previous Falling Mode |
new_state | FallingMode | The new Falling Mode |

Fireโ
When Character fires a Weapon
Character.Subscribe("Fire", function(self, weapon)
-- Fire was called
end)

GaitModeChangeโ
Called when GaitMode changes
Character.Subscribe("GaitModeChange", function(self, old_state, new_state)
-- GaitModeChange was called
end)

GrabPropโ
When Character grabs up a Prop
Character.Subscribe("GrabProp", function(self, prop)
-- GrabProp was called
end)

Highlightโ
When Character highlights/looks at a Prop or a Pickable
Character.Subscribe("Highlight", function(self, is_highlighted, object)
-- Highlight was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
is_highlighted | boolean | Whether the object is being highlighted or not |
object | Prop or Base Pickable | The Prop or Pickable being highlighted |

Interactโ
Triggered when a Character interacts with a Prop or Pickable
Character.Subscribe("Interact", function(self, object)
-- Interact was called
return true
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
object | Prop or Base Pickable | The Prop or Pickable being interacted with |
Returns
| Type | Description |
|---|---|
| boolean | Return false to prevent it |

LeaveVehicleโ
When Character leaves a vehicle
Character.Subscribe("LeaveVehicle", function(self, vehicle, seat_index)
-- LeaveVehicle was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
vehicle | Base Vehicle | The Vehicle |
seat_index | integer | The seat it left, 0 is the driver seat |
See also LeaveVehicle, AttemptLeaveVehicle.

PickUpโ
When Character picks up anything
Character.Subscribe("PickUp", function(self, object)
-- PickUp was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
object | Base Pickable | The Pickable being picked up |
See also GetPicked.

PullUseโ
Triggered when a Character presses the use button for a Pickable (i.e. clicks left mouse button with this equipped)
Character.Subscribe("PullUse", function(self, pickable)
-- PullUse was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that used it |
pickable | Base Pickable | The Pickable which has just been used |

Punchโ
When Character punches
Character.Subscribe("Punch", function(self)
-- Punch was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |

RagdollModeChangeโ
When Character enters or leaves ragdoll
Character.Subscribe("RagdollModeChange", function(self, old_state, new_state)
-- RagdollModeChange was called
end)

ReleaseUseโ
Triggered when a Character releases the use button for a Pickable (i.e. releases left mouse button with this equipped)
Character.Subscribe("ReleaseUse", function(self, pickable)
-- ReleaseUse was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that stopped using it |
pickable | Base Pickable | The Pickable which has just stopped being used |

Reloadโ
When Character reloads a weapon
Character.Subscribe("Reload", function(self, weapon, ammo_to_reload)
-- Reload was called
end)

StanceModeChangeโ
Called when StanceMode changes
Character.Subscribe("StanceModeChange", function(self, old_state, new_state)
-- StanceModeChange was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
old_state | StanceMode | The previous Stance Mode |
new_state | StanceMode | The new Stance Mode |

SwimmingModeChangeโ
Called when Swimming Mode changes
Character.Subscribe("SwimmingModeChange", function(self, old_state, new_state)
-- SwimmingModeChange was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Character | The Character that triggered the event |
old_state | SwimmingMode | The previous Swimming Mode |
new_state | SwimmingMode | The new Swimming Mode |

UnGrabPropโ
When Character drops a Prop
Character.Subscribe("UnGrabProp", function(self, prop)
-- UnGrabProp was called
end)

ViewModeChangeโ
When Character changes its View Mode
Character.Subscribe("ViewModeChange", function(self, old_state, new_state)
-- ViewModeChange was called
end)

WeaponAimModeChangeโ
Called when Weapon Aim Mode changes
Character.Subscribe("WeaponAimModeChange", function(self, old_state, new_state)
-- WeaponAimModeChange was called
end)
Male & Female Customizationโ
The following items can be used to customize Male & Female (nanos-world::SK_Male & nanos-world::SK_Female) default meshes from nanos world.
| Morph Targets | Mat. Scalar Params | Mat. Color Params | Mat. Texture Params |
|---|---|---|---|
nose1 | BaseColorPower | LipstickTint | Texture |
nose2 | Muscular | BrowsTint | LipstickMask |
brows | Specular | BlushTint | BrowsMask |
mouth | Roughness | EyeShadowTint | BlushMask |
fat | Scatter | UnderwearTint | EyeShadowMask |
nose3 | DetailAmount | HairTint | Normal |
chin | DetailScale | Tint | NormalMuscular |
face | UnderwearRoughness | UnderwearMask | |
nose4 | UnderwearSpecular | SR | |
skinny | HairScatter | HairTexture | |
jaw | HairAlphaPower | HairSpecular | |
brows2 | HairSpecularMultiplier | HairRoughness | |
angry | HairRoughnessMultiplier | HairTangent | |
smirk | HairPixelDepth | ||
smirk2 | |||
smirk3 | |||
smile | |||
nose6 | |||
jaw_forward | |||
lips | |||
lips2 | |||
mouth_wide | |||
eyes1 | |||
eyes2 | |||
eyes3 | |||
eyes4 | |||
eyes_retraction | |||
lips3 | |||
eyes5 | |||
nose7 | |||
forehead | |||
bodyfat |
Character's Skeleton Bone Namesโ
Full list of bones of the Character skeleton, which can be used in bone related methods such as :AttachTo() or :HideBone().
rootpelvisspine_01spine_02spine_03clavicle_lupperarm_llowerarm_lhand_lindex_01_lindex_02_lindex_03_l
middle_01_lmiddle_02_lmiddle_03_l
pinky_01_lpinky_02_lpinky_03_l
ring_01_lring_02_lring_03_l
thumb_01_lthumb_02_lthumb_03_l
weapon_l
clavicle_rupperarm_rlowerarm_rhand_rindex_01_rindex_02_rindex_03_r
middle_01_rmiddle_02_rmiddle_03_r
pinky_01_rpinky_02_rpinky_03_r
ring_01_rring_02_rring_03_r
thumb_01_rthumb_02_rthumb_03_r
weapon_r
neck_01headlefteyerighteyeleftlidupleftlidlowrightliduprightlitlow
thigh_lcalf_lfoot_lball_l
thigh_rcalf_rfoot_rball_r


