Skip to content

format

typescript
Animation.playAutomatically

class: Animation

description

Whether the default animation clip should automatically start playing on startup.

If the return value is true, the animation clip will automatically play when the game object is enabled. If it is false, the animation needs to be triggered manually through code or other means.

parameter

param_nametypedescription

reture

typedescription
booleanWhether to play automatically on startup

code example

typescript
let animation = this.gameObject.GetComponent<Animation>(Animation);
let play_auto = animation.playAutomatically;