Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | BR14Nx |
I am trying to get an animations length.
I load the animation_player
onready and also the animations length.
The Animation is called Attack_1
onready var attack1Length = animation_player.get_animation('Attack_1').length
gives me an
Invalid get index 'Attack_1' (on base: 'AnimationNodeStateMachinePlayback')
Nevertheless if I remove the underscore and searching for an Attack1 animation, I’ll get an Invalid get Index 'length' (on base: 'null instance')
error.
What do I do wrong?
From the looks of the error, the object animation_player
is of the class AnimationNodeStateMachinePlayback
which doesn’t have the method get_animation()
. Are you sure the object is an AnimationPlayer
? Could it be AnimationTree
or some other related class?
Ertain | 2023-02-12 22:50