BTPlayAnimation

Inherits: BTAction < BTTask < BT

BT action that plays an animation on the specified AnimationPlayer node.

Description

BTPlayAnimation action plays an animation on the specified AnimationPlayer node. If the await_completion is greater than 0, the action will wait for the animation to complete, with the maximum waiting time equal to await_completion.

Returns SUCCESS if the animation finishes playing or if the elapsed time exceeds await_completion. When await_completion is set to 0, BTPlayAnimation doesn’t wait for the animation to finish and immediately returns SUCCESS.

Returns RUNNING if the animation is still playing and the elapsed time is less than await_completion.

Returns FAILURE if the action fails to play the requested animation.

Properties

StringName

animation_name

&""

BBNode

animation_player

float

await_completion

0.0

float

blend

-1.0

bool

from_end

false

float

speed

1.0


Property Descriptions

StringName animation_name = &""

  • void set_animation_name ( StringName value )

  • StringName get_animation_name ( )

Animation’s key within the AnimationPlayer node. If empty, BTPlayAnimation will resume the last played animation if the AnimationPlayer was previously paused.


BBNode animation_player

  • void set_animation_player ( BBNode value )

  • BBNode get_animation_player ( )

Parameter that specifies the AnimationPlayer node.


float await_completion = 0.0

  • void set_await_completion ( float value )

  • float get_await_completion ( )

The maximum duration to wait for the animation to complete (in seconds). If the animation doesn’t finish within this time, BTAwaitAnimation will return FAILURE. If set to 0, BTPlayAnimation doesn’t wait for the animation to finish and immediately returns SUCCESS.


float blend = -1.0

  • void set_blend ( float value )

  • float get_blend ( )

Custom blend time (in seconds). See AnimationPlayer.play.


bool from_end = false

  • void set_from_end ( bool value )

  • bool get_from_end ( )

Play animation from the end. Used in combination with negative speed to play animation in reverse. See AnimationPlayer.play.


float speed = 1.0

  • void set_speed ( float value )

  • float get_speed ( )

Custom playback speed scaling ratio. See AnimationPlayer.play.