Skip to main content
Version: bleeding-edge ๐Ÿฉธ

๐Ÿง‘ 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

Server Only๐Ÿ”Auto-Distributed๐Ÿง‘โ€๐Ÿ’ปAPI Source
๐Ÿ‘ชInheritance
This class shares methods and events from Base Entity, Base Actor, Base Paintable, Base Damageable, Base Pawn.

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โ€‹

Server/Index.lua
-- 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
NameTypeDescription
locationVectorWorld location to spawn at
rotationRotatorWorld rotation to spawn with
skeletal_mesh_assetSkeletalMesh ReferenceThe Skeletal Mesh asset to use
collision_type?CollisionTypeCollision profile of this Actor Default CollisionType.Auto
gravity_enabled?booleanWhether gravity affects this Actor Default true
max_health?integerCurrent / Max Health Default 100
death_sound?Sound ReferencePlayed when Character dies, pass an empty string for no sound Default nanos-world::A_Male_01_Death
pain_sound?Sound ReferencePlayed when Character takes damage, pass an empty string for no sound Default nanos-world::A_Male_01_Pain
spawn_mode?SpawnModePass 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

๐Ÿฆ  Functionsโ€‹

Animation
PlayAnimationPlays an Animation Montage on this character
SetAnimationIdleWalkRunCrouchingSets the Blend Space (2D) Animation for Crouching
SetAnimationIdleWalkRunStandingSets the Blend Space (2D) Animation for Standing
SetAnimationsTransitionStandingCrouchingSets the Transition Animation between Standing and Crouching
Appearance
SetMeshChanges the Character Mesh at runtime
SetParachuteTextureChanges the texture of the Character's parachute
Audio
GetFootstepVolumeMultiplier: floatGets the Footstep Volume multiplier
SetDeathSoundChanges the Death sound when Character dies
SetFootstepVolumeMultiplierSet the Footstep Volume multiplier
SetPainSoundChanges the Pain sound when Character takes damage
Camera
GetCameraMode: CameraModeGets the camera mode
GetViewMode: ViewModeGets the View Mode
SetCameraModeSets the Camera Mode
SetFOVMultiplierSets the Field of View multiplier
SetViewModeSets the View Mode (first person, third person or top down)
Combat
GetCanAim: booleanGets if this Character is allowed to aim
GetCanPunch: booleanGets if this Character is allowed to punch
GetFallDamageTaken: integerGets the Fall Damage multiplier
GetImpactDamageTaken: integerGets the Impact Damage taken when being run over
GetPunchDamage: integerGets the damage dealt by this Character's punches
GetWeaponAimMode: AimModeGets the Weapon Aim Mode
GetWeaponShooterMode: booleanGets if this Character is in Shooter Mode
IsInvulnerable: booleanGets if this Character is invulnerable
SetCanAimSets if this Character is allowed to Aim
SetCanPunchSets if this Character is allowed to Punch
SetFallDamageTakenSet the Fall Damage multiplier taken when falling from High places
SetImpactDamageTakenSet the Impact Damage taken when being run over by things
SetInvulnerableSets if the Character can receive any damage
SetPunchDamageSet the Punch Damage this Character will apply on others
SetWeaponAimModeSets the Weapon's Aim Mode
SetWeaponShooterModeSets 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
DropDrops any Pickable the Character is holding
EnterVehicleEnters the Vehicle at Seat (0 - Driver)
GetCanDrop: booleanGets if this Character is allowed to drop the picked up item
GetCanGrabProps: booleanGets if this Character is allowed to grab Props
GetCanPickupPickables: booleanGets if this Character is allowed to pick up Pickables (Weapon, Grenade, Melee...)
GetCanUsePickables: booleanGets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...)
GetGrabbedProp: Prop or nilGets the Grabbed Prop
GetPicked: Base Pickable or nilGets the Pickable if picking up
GetVehicle: Base Vehicle or nilGets the entered Vehicle
GetVehicleSeat: integerGets the entered Vehicle seat
GrabPropGives a Prop to the Character
IsInputEnabled: booleanGets if this Character has input enabled
LeaveVehicleLeaves the current Vehicle
PickUpGives a Melee/Grenade/Weapon (Pickable) to the Character
SetCanDropSets if this Character is allowed to Drop the Picked up item
SetCanGrabPropsSets if this Character is allowed to Grab any Prop
SetCanPickupPickablesSets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Melee...)
SetCanUsePickablesSets if this Character is allowed to use Pickables (Weapon, Grenade, Melee...)
SetInputEnabledEnables/Disables Character's Input
UnGrabPropUnGrabs/Drops the Prop the Character is holding
Movement
GetCanDeployParachute: booleanGets if this Character is allowed to deploy the Parachute
GetCanDive: booleanGets if this Character is allowed to Dive
GetCanSprint: booleanGets if this Character is allowed to sprint
GetFallingMode: FallingModeGets the current Falling Mode
GetGaitMode: GaitModeGets the current Gait Mode
GetSpeedMultiplier: floatGets the movement speed multiplier
GetStanceMode: StanceModeGets the Stance Mode
GetSwimmingMode: SwimmingModeGets the Swimming Mode
LookAtAI: Tries to make this Character to look at Location
SetAccelerationSettingsSets the Movement Max Acceleration of this Character
SetAirControlSets the amount of movement control allowed when it is in air
SetCanDeployParachuteSets if this Character is allowed to deploy the Parachute
SetCanDiveSets if this Character is allowed to Dive
SetCanSprintSets if this Character is allowed to Sprint
SetGaitModeSets the Gait Mode (walking or sprinting)
SetHighFallingTimeSets time to transition to HighFalling state
SetSpeedMultiplierSets the multiplier applied to all movement speeds
SetStanceModeSets the Stance Mode (standing or crouching)
Physics
GetRadialDamageToRagdoll: integerGets the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode
IsInRagdollMode: booleanGets if Character is in ragdoll mode
ResetPhysicalAnimationSettingsResets all Physical Animation settings
SetPhysicalAnimationSettingsApplies the physical animation settings to the body given
SetPhysicsAssetSets the Physics Asset for the Character
SetRadialDamageToRagdollSet the minimum radial damage (e.g. explosions) taken to enter in ragdoll mode
SetRagdollModeEnables or disables the Ragdoll Mode, making the Character fall as a physics body
SetRagdollOnHitEnabledSets if the character will enter ragdoll mode when being hit by an object or falling from a high place
SetRagdollStandUpCooldownSets the cooldown time (in seconds) before this Character can stand up from ragdoll
SetSimulatePhysicsSets the Character Capsule to simulate physics

Inherited functions

Animationfunctionsโ€‹

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
NameTypeDescription
animation_pathAnimation ReferenceThe Animation asset to play
slot_type?AnimationSlotTypeWhich part of the body plays the animation Default AnimationSlotType.FullBody
loop_indefinitely?booleanWhether to keep looping until stopped Default false
blend_in_time?floatSeconds to blend into the animation Default 0.25
blend_out_time?floatPass it -1 to disable auto blend out and keep the animation running in last pose forever Default 0.25
play_rate?floatSpeed multiplier of the animation Default 1.0
stop_all_montages?booleanStops 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
NameTypeDescription
blend_space_pathAnimation ReferenceThe Blend Space (2D) asset
enable_turn_in_place?booleanWhether 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
NameTypeDescription
blend_space_pathAnimation ReferenceThe Blend Space (2D) asset
enable_turn_in_place?booleanWhether 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
NameTypeDescription
standing_to_crouchingAnimation ReferenceAnimation played when crouching
crouching_to_standingAnimation ReferenceAnimation played when standing up

Appearancefunctionsโ€‹

SetMeshSlowโ€‹

Changes the Character Mesh at runtime

my_character:SetMesh(skeletal_mesh_asset)
Parameters
NameTypeDescription
skeletal_mesh_assetSkeletalMesh ReferenceThe new Skeletal Mesh asset

SetParachuteTextureSlowโ€‹

Changes the texture of the Character's parachute

my_character:SetParachuteTexture(texture?)
Parameters
NameTypeDescription
texture?Image PathThe 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
TypeDescription
floatFootstep Volume multiplier

See also SetFootstepVolumeMultiplier.

SetDeathSoundSlowโ€‹

Changes the Death sound when Character dies

my_character:SetDeathSound(sound_asset?)
Parameters
NameTypeDescription
sound_asset?Sound ReferenceThe 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
NameTypeDescription
volume_multiplierfloatThe new Footstep Volume multiplier

See also GetFootstepVolumeMultiplier.

SetPainSoundSlowโ€‹

Changes the Pain sound when Character takes damage

my_character:SetPainSound(sound_asset?)
Parameters
NameTypeDescription
sound_asset?Sound ReferenceThe 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
TypeDescription
CameraModeCamera mode

See also SetCameraMode.

GetViewModeOptimalโ€‹

Gets the View Mode

local view_mode = my_character:GetViewMode()
Returns
TypeDescription
ViewModeView 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
NameTypeDescription
camera_modeCameraModeThe new Camera Mode

See also GetCameraMode.

SetFOVMultiplierOptimalโ€‹

Sets the Field of View multiplier

my_character:SetFOVMultiplier(multiplier)
Parameters
NameTypeDescription
multiplierfloatThe new Field of View multiplier

SetViewModeOptimalโ€‹

Sets the View Mode (first person, third person or top down)

my_character:SetViewMode(view_mode)
Parameters
NameTypeDescription
view_modeViewModeThe new View Mode

See also GetViewMode.

Combatfunctionsโ€‹

GetCanAimOptimalโ€‹

Gets if this Character is allowed to aim

local can_aim = my_character:GetCanAim()
Returns
TypeDescription
booleanWhether it is allowed to aim

See also SetCanAim.

GetCanPunchOptimalโ€‹

Gets if this Character is allowed to punch

local can_punch = my_character:GetCanPunch()
Returns
TypeDescription
booleanWhether it is allowed to punch

See also SetCanPunch.

GetFallDamageTakenOptimalโ€‹

Gets the Fall Damage multiplier

local damage = my_character:GetFallDamageTaken()
Returns
TypeDescription
integerThe Fall Damage multiplier

See also SetFallDamageTaken.

GetImpactDamageTakenOptimalโ€‹

Gets the Impact Damage taken when being run over

local impact_damage = my_character:GetImpactDamageTaken()
Returns
TypeDescription
integerThe Impact Damage

See also SetImpactDamageTaken.

GetPunchDamageOptimalโ€‹

Gets the damage dealt by this Character's punches

local punch_damage = my_character:GetPunchDamage()
Returns
TypeDescription
integerThe punch damage

See also SetPunchDamage.

GetWeaponAimModeOptimalโ€‹

Gets the Weapon Aim Mode

local aim_mode = my_character:GetWeaponAimMode()
Returns
TypeDescription
AimModeWeapon Aim Mode

See also SetWeaponAimMode.

GetWeaponShooterModeOptimalโ€‹

Gets if this Character is in Shooter Mode

local weapon_shooter_mode = my_character:GetWeaponShooterMode()
Returns
TypeDescription
booleanWhether this Character is in Shooter Mode

See also SetWeaponShooterMode.

IsInvulnerableOptimalโ€‹

Gets if this Character is invulnerable

local is_invulnerable = my_character:IsInvulnerable()
Returns
TypeDescription
booleanWhether this Character is invulnerable

See also SetInvulnerable.

SetCanAimOptimalโ€‹

Sets if this Character is allowed to Aim

my_character:SetCanAim(can_aim)
Parameters
NameTypeDescription
can_aimbooleanWhether this Character is allowed to Aim

See also GetCanAim.

SetCanPunchOptimalโ€‹

Sets if this Character is allowed to Punch

my_character:SetCanPunch(can_punch)
Parameters
NameTypeDescription
can_punchbooleanWhether 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
NameTypeDescription
damageintegerDefault 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
NameTypeDescription
impact_damageintegerDefault is 10

See also SetRagdollOnHitEnabled, GetImpactDamageTaken.

SetInvulnerableOptimalโ€‹

Sets if the Character can receive any damage

my_character:SetInvulnerable(is_invulnerable)
Parameters
NameTypeDescription
is_invulnerablebooleanWhether 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
NameTypeDescription
punch_damageintegerDefault is 15

See also GetPunchDamage.

SetWeaponAimModeModerateโ€‹

Sets the Weapon's Aim Mode

my_character:SetWeaponAimMode(aim_mode)
Parameters
NameTypeDescription
aim_modeAimModeThe 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
NameTypeDescription
weapon_shooter_modebooleanWhether 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โ€‹

DropModerateโ€‹

Drops any Pickable the Character is holding

my_character:Drop()

See also GetPicked, PickUp.

EnterVehicleModerateโ€‹

Enters the Vehicle at Seat (0 - Driver)

my_character:EnterVehicle(vehicle, seat?)
Parameters
NameTypeDescription
vehicleBase VehicleThe Vehicle
seat?integerSeat 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
TypeDescription
booleanWhether 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
TypeDescription
booleanWhether 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
TypeDescription
booleanWhether 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
TypeDescription
booleanWhether it is allowed to use Pickables

See also SetCanUsePickables.

GetGrabbedPropOptimalโ€‹

Gets the Grabbed Prop

local prop = my_character:GetGrabbedProp()
Returns
TypeDescription
Prop or nilGrabbed Prop

See also GrabProp, UnGrabProp.

GetPickedOptimalโ€‹

Gets the Pickable if picking up

local object = my_character:GetPicked()
Returns
TypeDescription
Base Pickable or nilPickable if picking up

See also PickUp, Drop.

GetVehicleOptimalโ€‹

Gets the entered Vehicle

local vehicle = my_character:GetVehicle()
Returns
TypeDescription
Base Vehicle or nilEntered Vehicle

See also EnterVehicle, LeaveVehicle.

GetVehicleSeatOptimalโ€‹

Gets the entered Vehicle seat

local seat_index = my_character:GetVehicleSeat()
Returns
TypeDescription
integerThe 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
NameTypeDescription
propPropThe Prop

See also GetGrabbedProp.

IsInputEnabledOptimalโ€‹

Gets if this Character has input enabled

local is_enabled = my_character:IsInputEnabled()
Returns
TypeDescription
booleanWhether 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
NameTypeDescription
pickableBase PickableThe Weapon, Melee or Grenade to give to this Character

See also Drop, GetPicked.

SetCanDropOptimalโ€‹

Sets if this Character is allowed to Drop the Picked up item

my_character:SetCanDrop(can_drop)
Parameters
NameTypeDescription
can_dropbooleanWhether 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
NameTypeDescription
can_grab_propsbooleanWhether 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
NameTypeDescription
can_pickupbooleanWhether 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
NameTypeDescription
can_usebooleanWhether this Character is allowed to use Pickables

See also GetCanUsePickables.

SetInputEnabledOptimalโ€‹

Enables/Disables Character's Input

my_character:SetInputEnabled(is_enabled)
Parameters
NameTypeDescription
is_enabledbooleanWhether to enable Character's Input

See also IsInputEnabled.

UnGrabPropModerateโ€‹

UnGrabs/Drops the Prop the Character is holding

my_character:UnGrabProp()

Movementfunctionsโ€‹

GetCanDeployParachuteOptimalโ€‹

Gets if this Character is allowed to deploy the Parachute

local can_deploy_parachute = my_character:GetCanDeployParachute()
Returns
TypeDescription
booleanWhether 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
TypeDescription
booleanWhether 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
TypeDescription
booleanWhether it is allowed to sprint

See also SetCanSprint.

GetFallingModeOptimalโ€‹

Gets the current Falling Mode

local ret = my_character:GetFallingMode()
Returns
TypeDescription
FallingModeThe current Falling Mode

GetGaitModeOptimalโ€‹

Gets the current Gait Mode

local gait_mode = my_character:GetGaitMode()
Returns
TypeDescription
GaitModeThe current Gait Mode

See also SetGaitMode.

GetSpeedMultiplierOptimalโ€‹

Gets the movement speed multiplier

local speed_multiplier = my_character:GetSpeedMultiplier()
Returns
TypeDescription
floatThe speed multiplier

See also SetSpeedMultiplier.

GetStanceModeOptimalโ€‹

Gets the Stance Mode

local stance_mode = my_character:GetStanceMode()
Returns
TypeDescription
StanceModeStance Mode

See also SetStanceMode.

GetSwimmingModeOptimalโ€‹

Gets the Swimming Mode

local swimming_mode = my_character:GetSwimmingMode()
Returns
TypeDescription
SwimmingModeSwimming Mode

LookAtModerateโ€‹

AI: Tries to make this Character to look at Location

my_character:LookAt(location)
Parameters
NameTypeDescription
locationVectorWorld location to look

SetAccelerationSettingsOptimalโ€‹

Sets the Movement Max Acceleration of this Character

my_character:SetAccelerationSettings(walking?, parachuting?, skydiving?, falling?, swimming?, swimming_surface?, flying?)
Parameters
NameTypeDescription
walking?integerMax acceleration while walking Default 768
parachuting?integerMax acceleration while parachuting Default 512
skydiving?integerMax acceleration while skydiving Default 768
falling?integerMax air control acceleration while falling Default 128
swimming?integerMax acceleration while swimming underwater Default 256
swimming_surface?integerMax acceleration while swimming on the surface Default 256
flying?integerMax 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
NameTypeDescription
air_control?floatWhen 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?floatWhen 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?floatWhen 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
NameTypeDescription
can_deploy_parachutebooleanWhether 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
NameTypeDescription
can_divebooleanWhether this Character is allowed to Dive

See also GetCanDive.

SetCanSprintOptimalโ€‹

Sets if this Character is allowed to Sprint

my_character:SetCanSprint(can_sprint)
Parameters
NameTypeDescription
can_sprintbooleanWhether this Character is allowed to Sprint

See also GetCanSprint.

SetGaitModeOptimalโ€‹

Sets the Gait Mode (walking or sprinting)

my_character:SetGaitMode(gait_mode)
Parameters
NameTypeDescription
gait_modeGaitModeThe 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
NameTypeDescription
timefloatDefault is 1 second

See also SetRagdollOnHitEnabled.

SetSpeedMultiplierOptimalโ€‹

Sets the multiplier applied to all movement speeds

my_character:SetSpeedMultiplier(speed_multiplier)
Parameters
NameTypeDescription
speed_multiplierfloat1 is normal

See also GetSpeedMultiplier.

SetStanceModeOptimalโ€‹

Sets the Stance Mode (standing or crouching)

my_character:SetStanceMode(stance_mode)
Parameters
NameTypeDescription
stance_modeStanceModeThe 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
TypeDescription
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
TypeDescription
booleanWhether 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
NameTypeDescription
bonestringThe body we will be driving
include_selfbooleanWhether to modify the given body
is_local_simulationbooleanWhether the drive targets are in world space or local
orientation_strength?floatThe strength used to correct orientation error Default 0
angular_velocity_strength?floatThe strength used to correct angular velocity error Default 0
position_strength?floatThe strength used to correct linear position error. Only used for non-local simulation Default 0
velocity_strength?floatThe strength used to correct linear velocity error. Only used for non-local simulation Default 0
max_linear_force?floatThe max force used to correct linear errors Default 0
max_angular_force?floatThe max force used to correct angular errors Default 0

SetPhysicsAssetSlowโ€‹

Sets the Physics Asset for the Character

my_character:SetPhysicsAsset(physics_asset?)
Parameters
NameTypeDescription
physics_asset?Other Asset ReferenceThe 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
NameTypeDescription
damageintegerDefault 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
NameTypeDescription
ragdoll_enabledbooleanWhether 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
NameTypeDescription
is_enabledbooleanWhether 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
NameTypeDescription
timefloatThe 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
NameTypeDescription
simulate_physicsbooleanThe new Character Capsule to simulate physics

๐Ÿš€ Eventsโ€‹

AttackTriggered when the Character effectively attacks with a Melee
AttemptEnterVehicleTriggered when a Character attempts to enter a vehicle
AttemptLeaveVehicleTriggered when this Character attempts to leave a vehicle
AttemptReloadTriggered when this Character attempts to reload
DropWhen Character drops the currently picked up Pickable
EnterVehicleWhen Character enters a vehicle
FallingModeChangeCalled when FallingMode changes
FireWhen Character fires a Weapon
GaitModeChangeCalled when GaitMode changes
GrabPropWhen Character grabs up a Prop
HighlightWhen Character highlights/looks at a Prop or a Pickable
InteractTriggered when a Character interacts with a Prop or Pickable
LeaveVehicleWhen Character leaves a vehicle
PickUpWhen Character picks up anything
PullUseTriggered when a Character presses the use button for a Pickable (i.e. clicks left mouse button with this equipped)
PunchWhen Character punches
RagdollModeChangeWhen Character enters or leaves ragdoll
ReleaseUseTriggered when a Character releases the use button for a Pickable (i.e. releases left mouse button with this equipped)
ReloadWhen Character reloads a weapon
StanceModeChangeCalled when StanceMode changes
SwimmingModeChangeCalled when Swimming Mode changes
UnGrabPropWhen Character drops a Prop
ViewModeChangeWhen Character changes its View Mode
WeaponAimModeChangeCalled when Weapon Aim Mode changes

Attackโ€‹

Triggered when the Character effectively attacks with a Melee

Character.Subscribe("Attack", function(self, melee)
-- Attack was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
meleeMeleeThe Melee

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
NameTypeDescription
selfCharacterThe Character that triggered the event
vehicleBase VehicleThe Vehicle
seat_indexintegerThe seat it is trying to enter, 0 is the driver seat
Returns
TypeDescription
booleanReturn 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
NameTypeDescription
selfCharacterThe Character that triggered the event
vehicleBase VehicleThe Vehicle
Returns
TypeDescription
booleanReturn 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
NameTypeDescription
selfCharacterThe Character that triggered the event
weaponWeaponThe Weapon
Returns
TypeDescription
booleanReturn 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
NameTypeDescription
selfCharacterThe Character that triggered the event
objectBase PickableThe Pickable being dropped
triggered_by_playerbooleanWhether 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
NameTypeDescription
selfCharacterThe Character that triggered the event
vehicleBase VehicleThe Vehicle
seat_indexintegerThe 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
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateFallingModeThe previous Falling Mode
new_stateFallingModeThe new Falling Mode

Fireโ€‹

When Character fires a Weapon

Character.Subscribe("Fire", function(self, weapon)
-- Fire was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
weaponWeaponThe Weapon

GaitModeChangeโ€‹

Called when GaitMode changes

Character.Subscribe("GaitModeChange", function(self, old_state, new_state)
-- GaitModeChange was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateGaitModeThe previous Gait Mode
new_stateGaitModeThe new Gait Mode

GrabPropโ€‹

When Character grabs up a Prop

Character.Subscribe("GrabProp", function(self, prop)
-- GrabProp was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
propPropThe Prop

Highlightโ€‹

When Character highlights/looks at a Prop or a Pickable

Character.Subscribe("Highlight", function(self, is_highlighted, object)
-- Highlight was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
is_highlightedbooleanWhether the object is being highlighted or not
objectProp or Base PickableThe 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
NameTypeDescription
selfCharacterThe Character that triggered the event
objectProp or Base PickableThe Prop or Pickable being interacted with
Returns
TypeDescription
booleanReturn false to prevent it

LeaveVehicleโ€‹

When Character leaves a vehicle

Character.Subscribe("LeaveVehicle", function(self, vehicle, seat_index)
-- LeaveVehicle was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
vehicleBase VehicleThe Vehicle
seat_indexintegerThe 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
NameTypeDescription
selfCharacterThe Character that triggered the event
objectBase PickableThe 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
NameTypeDescription
selfCharacterThe Character that used it
pickableBase PickableThe Pickable which has just been used

Punchโ€‹

When Character punches

Character.Subscribe("Punch", function(self)
-- Punch was called
end)
Arguments
NameTypeDescription
selfCharacterThe 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)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_statebooleanThe previous boolean
new_statebooleanThe new boolean

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
NameTypeDescription
selfCharacterThe Character that stopped using it
pickableBase PickableThe 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)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
weaponWeaponThe Weapon
ammo_to_reloadintegerHow many bullets are being reloaded

StanceModeChangeโ€‹

Called when StanceMode changes

Character.Subscribe("StanceModeChange", function(self, old_state, new_state)
-- StanceModeChange was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateStanceModeThe previous Stance Mode
new_stateStanceModeThe new Stance Mode

SwimmingModeChangeโ€‹

Called when Swimming Mode changes

Character.Subscribe("SwimmingModeChange", function(self, old_state, new_state)
-- SwimmingModeChange was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateSwimmingModeThe previous Swimming Mode
new_stateSwimmingModeThe new Swimming Mode

UnGrabPropโ€‹

When Character drops a Prop

Character.Subscribe("UnGrabProp", function(self, prop)
-- UnGrabProp was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
propPropThe Prop

ViewModeChangeโ€‹

When Character changes its View Mode

Character.Subscribe("ViewModeChange", function(self, old_state, new_state)
-- ViewModeChange was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateViewModeThe previous View Mode
new_stateViewModeThe new View Mode

WeaponAimModeChangeโ€‹

Called when Weapon Aim Mode changes

Character.Subscribe("WeaponAimModeChange", function(self, old_state, new_state)
-- WeaponAimModeChange was called
end)
Arguments
NameTypeDescription
selfCharacterThe Character that triggered the event
old_stateAimModeThe previous Aim Mode
new_stateAimModeThe new Aim Mode

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 TargetsMat. Scalar ParamsMat. Color ParamsMat. Texture Params
nose1BaseColorPowerLipstickTintTexture
nose2MuscularBrowsTintLipstickMask
browsSpecularBlushTintBrowsMask
mouthRoughnessEyeShadowTintBlushMask
fatScatterUnderwearTintEyeShadowMask
nose3DetailAmountHairTintNormal
chinDetailScaleTintNormalMuscular
faceUnderwearRoughnessUnderwearMask
nose4UnderwearSpecularSR
skinnyHairScatterHairTexture
jawHairAlphaPowerHairSpecular
brows2HairSpecularMultiplierHairRoughness
angryHairRoughnessMultiplierHairTangent
smirkHairPixelDepth
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โ€‹

info

Full list of bones of the Character skeleton, which can be used in bone related methods such as :AttachTo() or :HideBone().

  • root
    • pelvis
      • spine_01
        • spine_02
          • spine_03
            • clavicle_l
              • upperarm_l
                • lowerarm_l
                  • hand_l
                    • index_01_l
                      • index_02_l
                        • index_03_l
                    • middle_01_l
                      • middle_02_l
                        • middle_03_l
                    • pinky_01_l
                      • pinky_02_l
                        • pinky_03_l
                    • ring_01_l
                      • ring_02_l
                        • ring_03_l
                    • thumb_01_l
                      • thumb_02_l
                        • thumb_03_l
                    • weapon_l
            • clavicle_r
              • upperarm_r
                • lowerarm_r
                  • hand_r
                    • index_01_r
                      • index_02_r
                        • index_03_r
                    • middle_01_r
                      • middle_02_r
                        • middle_03_r
                    • pinky_01_r
                      • pinky_02_r
                        • pinky_03_r
                    • ring_01_r
                      • ring_02_r
                        • ring_03_r
                    • thumb_01_r
                      • thumb_02_r
                        • thumb_03_r
                    • weapon_r
            • neck_01
              • head
                • lefteye
                • righteye
                • leftlidup
                • leftlidlow
                • rightlidup
                • rightlitlow
      • thigh_l
        • calf_l
          • foot_l
            • ball_l
      • thigh_r
        • calf_r
          • foot_r
            • ball_r