Topic was automatically imported from the old Question2Answer platform.
Asked By
GunPoint
I need to change an animation’s length through code. I also want the keys to be scalable. I haven’t found any methods for changing an animation’s length. Can I do that?
Basicly you create custom length variable and assign it to time argument when inserting new key to track. With continous updateMode it should work with any amout of frames, if Im not mistaken.
After animation is set, you add it to your player by add_animation() function.
var speed = 0.5
$AnimationNode.playback_speed = speed
If the original Animation length is 5 seconds and you change speed to 0.5, the animation will play 10 seconds (half speed). If you change speed to 2, the animation will play at double speed and the lenght will be 2.5 seconds. 1 is for normal speed.