Update upper action||doc135459

September 20, 2022


 Entity:updateUpperAction(action, ticks) 
  • The class to which the function belongs:Entity


Update the upper-level action of the entity object. The playback priority of the upper-level action will be higher than that of the base action.


Variable name type Description
action string Action name
ticks int Playback duration, in frames, -1 will use the default duration of the action

Get action name

In the Action List in the Appearance Action List in the Character Editor, you can see all the actions that can be played under the changed character model and their corresponding action names

Value Returned

type Description
int Action duration, in frames

Code Samples

on the client side of the objectmount script, the upper action of updating the entity is run, and the animation duration of the action is obtained

local actionTime = this:updateUpperAction('run', -1)