Skip to content


CharacterAPI. Character represents player-controlled avatar or NPCs in the scene.


CharacterEntity YaCharacterAPI.Character(YaEntity entity)Beta
boolean YaCharacterAPI.IsCharacter(YaEntity entity)Beta
is character or not
boolean YaCharacterAPI.IsPlayerCharacter(YaEntity entity)Beta
is character controlled by input
YaEntity YaCharacterAPI.GetPlayerEntity(YaEntity avatarEntity)Beta
get avatar player entity
void YaCharacterAPI.OnPush(function callback<YaEntity, YaEntity, float3, number>)Beta
Push event
  • callback callback func
    1. target The character target been pushed
    2. trigger The push entity
    3. direction push direction
    4. distance push distance
void YaCharacterAPI.OnFall(function callback<YaEntity, number>)Beta
Fall event
void YaCharacterAPI.OnGround(function callback<YaEntity, number>)Beta
OnGround event
void YaCharacterAPI.OnEnterTrigger(function callback<YaEntity, YaEntity>)Beta
Enter trigger event
void YaCharacterAPI.OnExitTrigger(function callback<YaEntity, YaEntity>)Beta
Exit Trigger event
void YaCharacterAPI.OnDied(function callback<YaEntity>)Beta
Die event
void YaCharacterAPI.OnStartSwim(function callback<YaEntity>)Beta
Start swim event
void YaCharacterAPI.OnEndSwim(function callback<YaEntity>)Beta
End swim event
YaEntity YaCharacterAPI.GetToolByHand(YaEntity character)Beta
Get the Tool in hand
YaEntity YaCharacterAPI.GetToolByBonePoint(YaEntity character, number point)Beta
Get a tool on a binding
YaEntity[] YaCharacterAPI.GetToolsByBonePoint(YaEntity character, number point)Beta
Get all the Tools on a bind point
YaEntity[] YaCharacterAPI.GetAllTools(YaEntity character)Beta
Get all the tools on the character
void YaCharacterAPI.IgnoreLayerCollision(YaEntity character, number layer, boolean ignore)Beta
Whether the character movement ignores the blocking of the layer. This method is based on PhysicsAPI.CollisionGroupSetCollidable
void YaCharacterAPI.ClearIgnoreLayerCollision(YaEntity character)Beta
void YaCharacterAPI.OnEnterHit(YaEntity character, function callback<YaEntity, number, float3>)Beta
character hit enter
  • callback YaEntity: hit entity; int: The site of contact 0=side 1:Up -1:Down float3: The normal direction of the contact point
void YaCharacterAPI.OnExitHit(YaEntity character, function callback<YaEntity>)Beta
character hit exit
void YaCharacterAPI.OnPush(YaEntity character, function callback<YaEntity, float3, number>)Beta
Current character be pushed event
void YaCharacterAPI.OnFall(YaEntity character, function callback<number>)Beta
Current character fall event
void YaCharacterAPI.OnGround(YaEntity character, function callback<number>)Beta
The current character landing event