- Edited
Hello. I am new to non-visual scripting (been using Stencyl so far), so I have a bit of a hard time, because many things can go wrong.
I've been trying (unsuccessfully) to call the AnimationPlayer node so that I can change the play speed via code.
The AnimationPlayer is a child-node of my player scene. I am trying to double the animation speed while my character is sprinting, instead of making a new animation.
I tried many things, but non make any difference in my animation playback speed. I tried using call node. I tried the $ symbol like that: $AnimationPlayer.playback_speed = 2
I placed it in a simple if/else function that detects if the sprint button is pressed (the sprint works fine, only the animation is the problem). I even tried doing an onready var animation_speed = $AnimationPlayer.playback_speed at the beginning of the code and then call the animation_speed variable instead.
Not sure what I should do to make this work.
Thanks in advance