Skip to main content
Version: latest - a1.0.0 ⚖️

🧑 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

info

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.

info

Inheritance: This class inherits from Actor and Pickable. Please check it's pages for inherited Methods and Events.

Usage#

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(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 onlyman:AddSkeletalMeshAttached("shirt", "nanos-world::SK_Underwear") -- Men onlyman:AddSkeletalMeshAttached("pants", "nanos-world::SK_Pants") -- Men onlyman:AddSkeletalMeshAttached("shoes", "nanos-world::SK_Shoes_01")man:AddSkeletalMeshAttached("tie", "nanos-world::SK_Tie")
-- Adds Clothes to Womanwoman:AddSkeletalMeshAttached("full", "nanos-world::SK_CasualSet") -- Woman onlywoman:AddSkeletalMeshAttached("shoes", "nanos-world::SK_Sneakers")
-- Adds Beard to Manman: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 Manman:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Long", "hair_male")man:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Short", "hair_male")
-- Adds Hair to Womanwoman:AddStaticMeshAttached("hair", "nanos-world::SM_Hair_Kwang", "hair_female")

Constructor Parameters#

TypeNameDefault
VectorlocationVector(0, 0, 0)
RotatorrotationRotator(0, 0, 0)
stringskeletal_meshnanos-world::SK_Mannequin
CollisionTypecollision_typeCollisionType.Normal
CollisionTypecollision_typeCollisionType.Normal
booleangravity_enabledtrue
numberhealth/max_health100
stringdeath_soundsnanos-world::A_Male_01_Death
stringpain_soundsnanos-world::A_Male_01_Pain
Play as Propgetting-started/tutorials-and-examples/play-as-propNametagsgetting-started/tutorials-and-examples/name-tagsCharacter Meshes Guideassets-modding/creating-assets/characters-meshes

Functions#

Inherited Actor Functions
Base Actorscripting-reference/classes/base-classes/actor
ReturnsNameDescription
AddImpulseApplies a Force in world coordinate on this Actor
AttachToAttaches this Actor to any other Actor
DestroyDestroys this Actor
DetachDetaches this Actor if attached
SetCollisionSets the actor’s collision type
SetForceAdds a permanent force to this actor
SetGravityEnabledSets the actor’s gravity enabled
SetHighlightEnabledEnables this Actor Highlighting at a specific Index color
SetLifeSpanSets the actor’s life span to be destroyed
SetLocationSets the actor’s location in the game world
SetNetworkAuthoritySets this actor’s new Player Network Authority
SetRelativeLocationSets the actor’s relative location in local space
SetRelativeRotationSets the actor’s relative rotation in local space
SetRotationSets the actor’s rotation in the game world
SetScaleSets the actor’s scale
SetValueSets a value in this entity, which can be accessed by any package
TranslateToSmoothly moves this actor to a Location
RotateToSmoothly rotates this actor to a Rotation
booleanIsGravityEnabledGets the actor’s gravity enabled
booleanIsInWaterGets if the actor is in Water
booleanIsNetworkDistributedGets if the actor is Network Distributed
booleanIsValidReturns if this entity is valid (i.e. not destroyed)
tableGetAttachedEntitiesGets all actors attached to this entity
anyGetAttachedToGets the actor this actor is attached to
tableGetBoundsGets the actor bounds size
numberGetCollisionGets the current actor’s collision
numberGetIDGets the universal network ID of this entity
VectorGetLocationGet the actor’s position in the game world
VectorGetInitialLocationGets the initial location
RotatorGetRotationGets the actor’s rotation in the game world
VectorGetScaleGets the actor’s scale
stringGetTypeReturns the type of this Actor
anyGetValueGets a value given a key
VectorGetVelocityReturns the current actor Velocity
SubscribeSubscribes for an Event
UnsubscribeUnsubscribes from Events
Inherited Paintable Functions
Base Paintablescripting-reference/classes/base-classes/paintable
ReturnsNameDescription
SetMaterialReplace a materials of this actor with another Material
SetMaterialFromWebUIReplace a materials of this actor with a WebUI
SetMaterialColorParameterSets a Color parameter in this actor’s material
SetMaterialScalarParameterSets a scalar parameter in this actor’s material
SetMaterialTextureParameterLoads a image from computer (relative to Assets/ folder) and sets as parameter in this actor’s material
SetMaterialVectorParameterSets a Vector parameter in this actor’s material
ReturnsNameDescription
numberApplyDamageDo damage in a character
AddSkeletalMeshAttachedSpawns and Attaches a SkeletalMesh into this Character
AddStaticMeshAttachedSpawns and Attaches a StaticMesh into this Character
DropDrops any Pickable the Character is holding
EnterVehicleEnters the Vehicle at Seat (0 - Driver)
GrabPropGives a Prop to the Character
HideBoneHides a bone of this Character
UnHideBoneUnHides a bone of this Character
IsBoneHiddenGets if a bone is hidden
JumpTriggers this Character to jump
LeaveVehicleLeaves the current Vehicle
LookAtAI: Tries to make this Character to look at Location
MoveToAI: Makes this Character to walk to the Location
PickUpGives a Item/Grenade/Weapon (Pickable) to the Character
PlayAnimationPlays an Animation Montage on this character
RemoveSkeletalMeshAttachedRemoves, if existing, a SkeletalMesh from this Character given it’s custom ID
RemoveStaticMeshAttachedRemoves, if existing, a StaticMesh from this Character given it’s custom ID
RespawnRespawns the Character, fullying it’s Health and moving it to it’s Initial Location
SetAccelerationSettingsSets the Movement Max Acceleration of this Character.
SetBrakingSettingsSets the Movement Braking Settings of this Character.
SetCameraModeSets the Camera Mode
SetCameraOffsetSets the Camera Offset (only affects TPS)
SetCanCrouchSets if this Character is allowed to Crouch and to Prone
SetCanAimSets if this Character is allowed to Aim
SetCanSprintSets if this Character is allowed to Sprint
SetCanGrabPropsSets if this Character is allowed to Grab any Prop
SetCanPickupPickablesSets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Item…)
SetCanPunchSets if this Character is allowed to Punch (Melee)
SetCapsuleSizeSets this Character’s Capsule size
SetDamageMultiplierChanges how much damage this character takes
SetDeathSoundChanges the Death sound when Character dies
SetFallDamageTakenSet the Fall Damage multiplier taken when falling from High places
SetFlyingModeSets the Flying Mode
SetGaitModeSets the Gait Mode
SetGravityScaleChanges the Gravity Scale of this Character
SetHealthSets the Health of this Character. If the character is dead, respawns it with full health
SetImpactDamageTakenSet the Impact Damage taken when being roamed by things
SetInvulnerableSets if the Character can receive any damage
SetMaxHealthSets the MaxHealth of this Character
SetMeshChanges the Character Mesh on the fly
SetMorphTarget
SetMovementEnabledEnables/Disables Character’s Movement
SetPainSoundChanges the Pain sound when Character takes damage
SetPunchDamageSet the Punch Damage this Character will apply on others
SetRagdollModeSets Character Ragdoll Mode
SetSpeedMultiplier1 = normal
SetStanceModeStance Modes: None, Standing, Crouching, Proning
SetTeamSets a Team which will disable damaging same Team Members. 0 for Neutral
SetViewModeView Modes: FPS, TPS1, TPS2, TPS3
SetWeaponAimModeAim Modes: None, ADS, ZoomedZoom, Zoomed, ZoomedFar
StopAnimationStops an Animation Montage on this character
UnGrabPropUnGrabs/Drops the Prop the Character is holding
booleanIsInRagdollModeGets Character Ragdoll Mode
booleanIsInvulnerableGets if the Character can receive damage
booleanIsMovementEnabledGets Character Movement Enabled
CameraModeGetCameraMode
booleanGetCanDrop
booleanGetCanPunch
booleanGetCanAim
booleanGetCanCrouch
booleanGetCanSprint
booleanGetCanGrabProps
booleanGetCanPickupPickables
RotatorGetControlRotationGets the rotation this character is looking at
numberGetDamageMultiplier
numberGetFallDamageTaken
FallingModeGetFallingModeGets the Falling Mode
booleanGetFlyingModeGets if the Character is in Flying Mode
CollisionTypeGetGaitModeGets the Gait Mode
PropGetGrabbedPropGets the Grabbing Prop
numberGetGravityScaleGets the Gravity Scale of this Character
numberGetHealthGets the Character’s Health.
numberGetImpactDamageTaken
numberGetMaxHealthGets the Character’s MaxHealth.
stringGetMeshGets the Mesh Asset name
VectorGetMovingToGets if Character is moving to
PickableGetPickedGets the holding Picked Item/Grenade/Weapon
PlayerGetPlayerGets the Player controlling this Character
numberGetPunchDamage
numberGetSpeedMultiplier
StanceModeGetStanceMode
SwimmingModeGetSwimmingMode
numberGetTeam
VehicleGetVehicleGets the Vehicle the Character is on
ViewModeGetViewModeGets Character View Mode
AimModeGetWeaponAimModeGets Character Aim Mode

Events#

Inherited Actor Events
Base Actorscripting-reference/classes/base-classes/actor
NameDescription
DestroyTriggered when an Entity is Destroyed
SpawnTriggered when an Entity is Spawned/Created
ValueChangeTriggered when an Entity has it’s value changed
NameDescription
DeathWhen Character Dies
DropWhen Character drops anything
EnterVehicleWhen Character enters a vehicle
AttemptEnterVehicleWhen Character attempts to enter a vehicle
FallingModeChanged
FireWhen Character fires a Weapon
GaitModeChanged
GrabPropWhen Character grabs up a Prop
HighlightWhen Character highlights/looks at a Prop or a Pickable
InteractWhen a Character interacts with a Prop or Pickable to pick it up
LeaveVehicleWhen Character leaves a vehicle
AttemptLeaveVehicleWhen Character attempts to leave a vehicle
MoveCompletedCalled when AI reaches it’s destination, or when it fails
PickUpWhen Character picks up anything
PossessedWhen Character is possessed
PunchWhen Character punches
RagdollModeChanged
AttemptReloadWhen Character attempts to reload a weapon
ReloadWhen Character reloads a weapon
RespawnWhen Character Respawns
StanceModeChanged
SwimmingModeChanged
TakeDamageWhen Character takes Damage
UnGrabPropWhen Character drops a Prop
UnPossessedWhen Character is unpossessed
ViewModeChanged
WeaponAimModeChanged

Functions Detailed#

ApplyDamage#

Do damage in a character, will trigger all related events and apply modified damage based on bone. Also will apply impulse if it's a heavy explosion

my_character:ApplyDamage(damage, bone_name, damage_type, from_direction, instigator)
TypeParameterDefault ValueDescription
numberdamage
stringbone_name``
DamageTypedamage_typeDamageType.Shot
Vectorfrom_directionVector()
Playerinstigatornil

AddSkeletalMeshAttached#

Spawns and Attaches a SkeletalMesh into this Character, the SkeletalMesh must have the same Skeletal used by the Character Mesh, and will follow all animations from it. Uses a custom ID to be used for removing it further

my_character:AddSkeletalMeshAttached(id, skeletal_mesh_path)
TypeParameterDefault ValueDescription
stringid
stringskeletal_mesh_path``

AddStaticMeshAttached#

Spawns and Attaches a StaticMesh into this Character in a Socket with relative Location and Rotation. Uses a custom ID to be used for removing it further

my_character:AddStaticMeshAttached( id, static_mesh_path, socket, relative_location, relative_rotation)
TypeParameterDefault ValueDescription
stringid
stringstatic_mesh_path``
stringsocket``
Vectorrelative_locationVector()
Rotatorrelative_rotationRotator()

Drop#

Drops any Pickable the Character is holding

my_character:Drop()

EnterVehicle#

Enters the Vehicle at Seat (0 - Driver)

my_character:EnterVehicle(vehicle, seat)
TypeParameterDefault ValueDescription
Vehiclevehicle
numberseat0

GrabProp#

Gives a Prop to the Character

my_character:GrabProp(prop)
TypeParameterDefault ValueDescription
Propprop

HideBone#

Hides a bone of this Character. Check Bone Names List for all Bone names

my_character:HideBone(bone_name)
TypeParameterDefault ValueDescription
stringbone_name

UnHideBone#

UnHide a bone of this Character. Check Bone Names List for all Bone names

my_character:UnHideBone(bone_name)
TypeParameterDefault ValueDescription
stringbone_name

IsBoneHidden#

Check if a Bone is Hidden

Returns boolean

my_character:IsBoneHidden(bone_name)
TypeParameterDefault ValueDescription
stringbone_name

Jump#

Triggers this Character to jump

my_character:Jump()

LeaveVehicle#

Leaves the current Vehicle

my_character:LeaveVehicle()

LookAt#

AI: Tries to make this Character to look at Location

my_character:LookAt(location)
TypeParameterDefault ValueDescription
Vectorlocation

MoveTo#

AI: Makes this Character to walk to the Location

Triggers event MoveCompleted.

my_character:MoveTo(location, acceptance_radius)
TypeParameterDefault ValueDescription
Vectorlocation
numberacceptance_radius50

PickUp#

Gives a Item/Grenade/Weapon (Pickable) to the Character

my_character:PickUp(pickable)
TypeParameterDefault ValueDescription
Pickablepickable

PlayAnimation#

Plays an Animation Montage on this character

my_character:PlayAnimation(animation_path, slot_type, loop_indefinitely, blend_in_time, blend_out_time, play_rate)
TypeParameterDefault ValueDescription
stringanimation_path
AnimationSlotTypeslot_typeAnimationSlotType.FullBody
booleanloop_indefinitelyfalse
numberblend_in_time0.25
numberblend_out_time0.25
numberplay_rate1.0

RemoveSkeletalMeshAttached#

Removes, if existing, a SkeletalMesh from this Character given it's custom ID

my_character:RemoveSkeletalMeshAttached(id)
TypeParameterDefault ValueDescription
stringid

RemoveStaticMeshAttached#

Removes, if existing, a StaticMesh from this Character given it's custom ID

my_character:RemoveStaticMeshAttached(id)
TypeParameterDefault ValueDescription
stringid

Respawn#

Respawns the Character, fullying it's Health and moving it to it's Initial Location

my_character:Respawn(location, rotation)
TypeParameterDefault ValueDescription
Vectorlocationinitial locationIf not passed will use the initial location passed when the Character spawned
RotatorrotationRotator(0, 0, 0)

SetAccelerationSettings#

Sets the Movement Max Acceleration of this Character.

my_character:SetAccelerationSettings(walking, parachuting, skydiving, falling, swimming, swimming_surface, flying)
TypeParameterDefault ValueDescription
numberwalking768
numberparachuting512
numberskydiving768
numberfalling128
numberswimming256
numberswimming_surface256
numberflying1024

SetBrakingSettings#

Sets the Movement Braking Settings of this Character.

my_character:SetBrakingSettings(ground_friction, braking_friction_factor, braking_walking, braking_flying, braking_swimming, braking_falling)
TypeParameterDefault ValueDescription
numberground_friction2
numberbraking_friction_factor2
numberbraking_walking96
numberbraking_flying3000
numberbraking_swimming10
numberbraking_falling0

SetCameraMode#

Sets the Camera Mode (i.e. Only TPS, FPS or if allow both)

my_character:SetCameraMode(camera_mode)
TypeParameterDefault ValueDescription
CameraModecamera_mode

SetCameraOffset#

Sets the Camera Offset (only affects TPS)

my_character:SetCameraOffset(camera_offset)
TypeParameterDefault ValueDescription
Vectorcamera_offset

SetCanCrouch#

Sets if this Character is allowed to Crouch and to Prone

my_character:SetCanCrouch(can_crouch)
TypeParameterDefault ValueDescription
booleancan_crouch

SetCanAim#

Sets if this Character is allowed to Aim

my_character:SetCanAim(can_aim)
TypeParameterDefault ValueDescription
booleancan_aim

SetCanSprint#

Sets if this Character is allowed to Sprint

my_character:SetCanSprint(can_sprint)
TypeParameterDefault ValueDescription
booleancan_sprint

SetCanGrabProps#

Sets if this Character is allowed to Grab any Prop

my_character:SetCanGrabProps(can_grab_props)
TypeParameterDefault ValueDescription
booleancan_grab_props

SetCanPickupPickables#

Sets if this Character is allowed to Pick up any Pickable (Weapon, Grenade, Item...)

my_character:SetCanPickupPickables(can_pickup)
TypeParameterDefault ValueDescription
booleancan_pickup

SetCanPunch#

Sets if this Character is allowed to Punch (Melee)

my_character:SetCanPunch(can_punch)
TypeParameterDefault ValueDescription
booleancan_punch

SetCapsuleSize#

Sets this Character's Capsule size (will affect Camera location and Character's collision) - default is (42, 96)

my_character:SetCapsuleSize(radius, half_height)
TypeParameterDefault ValueDescription
booleanradius
booleanhalf_height

SetDamageMultiplier#

Changes how much damage this character takes

my_character:SetDamageMultiplier(bone_name, multiplier)
TypeParameterDefault ValueDescription
stringbone_name
numbermultiplier

SetDeathSound#

Changes the Death sound when Character dies

my_character:SetDeathSound(sound_asset)
TypeParameterDefault ValueDescription
stringsound_asset

SetFallDamageTaken#

Set the Fall Damage multiplier taken when falling from High places (default: 10). Setting to 0 will make the Character to do not take damage or enter ragdoll mode

my_character:SetFallDamageTaken(damage)
TypeParameterDefault ValueDescription
numberdamage

SetFlyingMode#

Sets the Flying Mode

my_character:SetFlyingMode(flying_mode)
TypeParameterDefault ValueDescription
booleanflying_mode

SetGaitMode#

Gait Modes: None, Walking, Sprinting

my_character:SetGaitMode(mode)
TypeParameterDefault ValueDescription
GaitModemode

SetGravityScale#

Changes the Gravity Scale of this Character (can be negative)

my_character:SetGravityScale(scale)
TypeParameterDefault ValueDescription
Vectorscale

SetHealth#

Sets the Health of this Character. If the character is dead, respawns it with full health

my_character:SetHealth(new_health)
TypeParameterDefault ValueDescription
numbernew_health

SetImpactDamageTaken#

Set the Impact Damage taken when being roamed by things (default: 10). Setting to 0 will make the Character to do not take damage or enter ragdoll mode

my_character:SetImpactDamageTaken(damage)
TypeParameterDefault ValueDescription
numberdamage

SetInvulnerable#

Sets if the Character can receive any damage

my_character:SetInvulnerable(is_invulnerable)
TypeParameterDefault ValueDescription
booleanis_invulnerable

SetMaxHealth#

Sets the MaxHealth of this Character

my_character:SetMaxHealth(new_max_health)
TypeParameterDefault ValueDescription
numbernew_max_health

SetMesh#

Changes the Character Mesh on the fly

my_character:SetMesh(skeletal_mesh_asset)
TypeParameterDefault ValueDescription
stringskeletal_mesh_asset

SetMorphTarget#

my_character:SetMorphTarget(key, value)
TypeParameterDefault ValueDescription
stringskeletal_mesh_asset
numbervalue

SetMovementEnabled#

Enables/Disables Character's Movement

my_character:SetMovementEnabled(is_movement_enabled)
TypeParameterDefault ValueDescription
booleanis_movement_enabled

SetPainSound#

Changes the Pain sound when Character takes damage

my_character:SetPainSound(sound_asset)
TypeParameterDefault ValueDescription
stringsound_asset

SetPunchDamage#

Set the Punch Damage this Character will apply on others (default is 15)

my_character:SetPunchDamage(damage)
TypeParameterDefault ValueDescription
numberdamage

SetRagdollMode#

Sets Character Ragdoll Mode

my_character:SetRagdollMode(ragdoll_enabled)
TypeParameterDefault ValueDescription
booleanragdoll_enabled

SetSpeedMultiplier#

1 = normal

my_character:SetSpeedMultiplier(multiplier)
TypeParameterDefault ValueDescription
numbermultiplier

SetStanceMode#

Stance Modes: None, Standing, Crouching, Proning

my_character:SetStanceMode(mode)
TypeParameterDefault ValueDescription
StanceModemode

SetTeam#

Sets a Team which will disable damaging same Team Members. 0 for Neutral

my_character:SetTeam(team)
TypeParameterDefault ValueDescription
numberteam

SetViewMode#

View Modes: FPS, TPS1, TPS2, TPS3

my_character:SetViewMode(view_mode)
TypeParameterDefault ValueDescription
ViewModeview_mode

SetWeaponAimMode#

Aim Modes: None, ADS, ZoomedZoom, Zoomed, ZoomedFar

my_character:SetWeaponAimMode(aim_mode)
TypeParameterDefault ValueDescription
AimModeaim_mode

StopAnimation#

Stops an Animation Montage on this character

my_character:StopAnimation(animation_path = "")
TypeParameterDefault ValueDescription
stringanimation_path``

UnGrabProp#

UnGrabs/Drops the Prop the Character is holding

my_character:UnGrabProp()

IsInRagdollMode#

Gets Character Ragdoll Mode

Returns boolean

my_character:IsInRagdollMode()

IsInvulnerable#

Gets if the Character can receive damage

Returns boolean

my_character:IsInvulnerable()

IsMovementEnabled#

Gets Character Movement Enabled

Returns boolean

my_character:IsMovementEnabled()

GetCameraMode#

Returns CameraMode

my_character:GetCameraMode()

GetCanDrop#

Returns boolean

my_character:GetCanDrop()

GetCanPunch#

Returns boolean

my_character:GetCanPunch()

GetCanAim#

Returns boolean

my_character:GetCanAim()

GetCanCrouch#

Returns boolean

my_character:GetCanCrouch()

GetCanSprint#

Returns boolean

my_character:GetCanSprint()

GetCanGrabProps#

Returns boolean

my_character:GetCanGrabProps()

GetCanPickupPickables#

Returns boolean

my_character:GetCanPickupPickables()

GetControlRotation#

Gets the rotation this character is looking at

Returns Rotator

my_character:GetControlRotation()

GetDamageMultiplier#

Returns number

my_character:GetDamageMultiplier()

GetFallDamageTaken#

Returns number

my_character:GetFallDamageTaken()

GetFallingMode#

Gets the Falling Mode

Returns FallingMode

my_character:GetFallingMode()

GetFlyingMode#

Gets if the Character is in Flying Mode

Returns FlyingMode

my_character:GetFlyingMode()

GetGaitMode#

Gets the Gait Mode

Returns GaitMode

my_character:GetGaitMode()

GetGrabbedProp#

Gets the Grabbing Prop

Returns Prop

my_character:GetGrabbedProp()

GetGravityScale#

Gets the Gravity Scale of this Character

Returns number

my_character:GetGravityScale()

GetHealth#

Gets the Character's Health.

Returns number

my_character:GetHealth()

GetImpactDamageTaken#

Returns number

my_character:GetImpactDamageTaken()

GetMaxHealth#

Gets the Character's MaxHealth.

Returns number

my_character:GetMaxHealth()

GetMesh#

Gets the Mesh Asset name

Returns string

my_character:GetMesh()

GetMovingTo#

Gets the Character moving to location, returns Vector(0, 0, 0) if it's not

Returns Vector

my_character:GetMesh()

GetPicked#

Gets the holding Picked Item/Grenade/Weapon

Returns Pickable

my_character:GetPicked()

GetPlayer#

Gets the Player controlling this Character

Returns Player

my_character:GetPlayer()

GetPunchDamage#

Returns number

my_character:GetSpeedMultiplier()

GetSpeedMultiplier#

Returns number

my_character:GetSpeedMultiplier()

GetStanceMode#

Returns StanceMode

my_character:GetStanceMode()

GetSwimmingMode#

Returns SwimmingMode

my_character:GetSwimmingMode()

GetTeam#

Returns number

my_character:GetTeam()

GetVehicle#

Gets the Vehicle the Character is on

Returns Vehicle

my_character:GetVehicle()

GetViewMode#

Gets Character View Mode

Returns ViewMode

my_character:GetViewMode()

GetWeaponAimMode#

Gets Character Aim Mode

Returns AimMode

my_character:GetWeaponAimMode()

Events Detailed#

Death#

When Character Dies

Character.Subscribe("Death", function(self, last_damage_taken, last_bone_damage, damage_type_reason, hit_from_direction, instigator)
end)
TypeParameterDescription
Characterself
numberlast_damage_taken
stringlast_bone_damaged
DamageTypedamage_type_reason
Vectorhit_from_direction
Playerinstigator

Drop#

When Character drops the currently picked up Pickable

Character.Subscribe("Drop", function(self, object, triggered_by_player)
end)
TypeParameterDescription
Characterself
Pickableobject
booleantriggered_by_player

EnterVehicle#

When Character enters a vehicle

Character.Subscribe("EnterVehicle", function(self, vehicle, seat_index)
end)
TypeParameterDescription
Characterself
Vehiclevehicle
numberseat_index

AttemptEnterVehicle#

When Character attempts to enter a vehicle

Character.Subscribe("AttemptEnterVehicle", function(self, vehicle, seat_index)
end)
TypeParameterDescription
Characterself
Vehiclevehicle
numberseat_index

FallingModeChanged#

Falling Modes: None, Jumping, Climbing, Vaulting, Falling, HighFalling, Parachuting, SkyDiving

Character.Subscribe("FallingModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
FallingModeold_state
FallingModenew_state

Fire#

When Character fires a Weapon

Character.Subscribe("Fire", function(self, weapon)
end)
TypeParameterDescription
Characterself
Weaponweapon

GaitModeChanged#

Gait Modes: None, Walking, Sprinting

Character.Subscribe("GaitModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
GaitModeold_state
GaitModenew_state

GrabProp#

When Character grabs up a Prop

Character.Subscribe("GrabProp", function(self, prop)
end)
TypeParameterDescription
Characterself
Propprop

Highlight#

When Character highlights/looks at a Prop or a Pickable

Character.Subscribe("Highlight", function(self, object)
end)
TypeParameterDescription
Characterself
Prop or Pickableobject

Interact#

When a Character interacts with a Prop or Pickable to pick it up

Return false to prevent it

Character.Subscribe("Interact", function(self, object)
end)
TypeParameterDescription
Characterself
Pickable or Propobject

LeaveVehicle#

When Character leaves a vehicle

Character.Subscribe("LeaveVehicle", function(self, vehicle)
end)
TypeParameterDescription
Characterself
Vehiclevehicle

AttemptLeaveVehicle#

When Character attempts to leave a vehicle

Character.Subscribe("AttemptLeaveVehicle", function(self, vehicle)
end)
TypeParameterDescription
Characterself
Vehiclevehicle

MoveCompleted#

Called when AI reaches it's destination, or when it fails

Character.Subscribe("MoveCompleted", function(self, succeeded)
end)
TypeParameterDescription
Characterself
booleansucceeded

PickUp#

When Character picks up anything

Character.Subscribe("PickUp", function(self, object)
end)
TypeParameterDescription
Characterself
Pickableobject

Possessed#

When Character is possessed

Character.Subscribe("Possessed", function(self, possesser)
end)
TypeParameterDescription
Characterself
Playerpossesser

Punch#

When Character punches

Character.Subscribe("Punch", function(self)
end)
TypeParameterDescription
Characterself

RagdollModeChanged#

When Character enters or leaves ragdoll

Character.Subscribe("RagdollModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
booleanold_state
booleannew_state

AttemptReload#

When Character attempts to reload a weapon

Return false to prevent it

Character.Subscribe("AttemptReload", function(self, weapon)
end)
TypeParameterDescription
Characterself
Weaponweapon

Reload#

When Character reloads a weapon

Character.Subscribe("Reload", function(self, weapon, ammo_to_reload)
end)
TypeParameterDescription
Characterself
Weaponweapon
numberammo_to_reload

Respawn#

When Character Respawns

Character.Subscribe("Respawn", function(self)
end)
TypeParameterDescription
Characterself

StanceModeChanged#

Stance Modes: None, Standing, Crouching, Proning

Character.Subscribe("StanceModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
StanceModeold_state
StanceModenew_state

SwimmingModeChanged#

Swimming Modes: None, Surface, Underwater

Character.Subscribe("SwimmingModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
SwimmingModeold_state
SwimmingModenew_state

TakeDamage#

When Character takes Damage

Return false to cancel the damage (will still display animations, particles and apply impact forces)

Character.Subscribe("TakeDamage", function(self, damage, bone, type, from_direction, instigator, causer)
end)
TypeParameterDescription
Characterself
numberdamage
stringboneDamaged bone
DamageTypetypeDamage Type
Vectorfrom_directionDirection of the damage relative to the damaged actor
PlayerinstigatorThe player which caused the damage
anycauserThe object which caused the damage

UnGrabProp#

When Character drops a Prop

Character.Subscribe("UnGrabProp", function(self, prop)
end)
TypeParameterDescription
Characterself
Propprop

UnPossessed#

When Character is unpossessed

Character.Subscribe("UnPossessed", function(self, old_possesser)
end)
TypeParameterDescription
Characterself
Playerold_possesser

ViewModeChanged#

When Character changes it's View Mode: FPS, TPS1, TPS2, TPS3

Character.Subscribe("ViewModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
ViewModeold_state
ViewModenew_state

WeaponAimModeChanged#

Aim Modes: None, ADS, ZoomedZoom, Zoomed, ZoomedFar

Character.Subscribe("WeaponAimModeChanged", function(self, old_state, new_state)
end)
TypeParameterDescription
Characterself
AimModeold_state
AimModenew_state

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

Ugly list I know.

  • 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