The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

AnimationTree Node allows blending animations created in AnimationPlayer Node
but I can't find how to set the speed of the animations and I don't want to modify animations keyframe by keyframe. I set animations by using eg:

 $animation_tree.["parameters/playback"].travel("Idle")

on process function.

setting the AnimatioPlayer's playback_speed parameter using

$AnimationPlayer.set_speed_scale(2) 

or

$AnimationPlayer.playback_speed = 2

only changes the speed in editor but not at runtime

how to solve it?

scene

in Engine by (454 points)
edited by

Solved it by adding the StateMachine inside the blendtree and adding a time scale node before the output.

1 Answer

+5 votes
Best answer

You need to use a BlendTree, inside the BlendTree add your animation and a TimeScale, then in code you can set it with something like

$animation_tree.set("parameters/BlendTree/TimeScale/scale", 2.0)

(Edited the parameters)

by (1,002 points)
selected by

I don't get it? I'm using BlendSpace2D so I can't set the animation speed there? Design hell

You can, when adding a point in the BlendSpace2D select "Add BlendTree" select the point and the button "Open Editor" will open, there tou can add the timescale and your animation

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.