Can I drive physics from an AnimationTree?

Godot Version

4.6

Question

I’m setting up an animation tree which is a mix of in-place animations, such as walking on the spot or swimming in place, and more complex animations that move the player around, such as jumping up for a flip kick or diving into the water.

For the in-place animations, I can just have the AnimationTree play the walking animation while code moves the have my CharacterBody3D that represents my player, but for the more complex animations, I’d like there to be some way for the body of my player follow the more complex animation.

For example, the diving animation has the player jumping into the air and then down and forward about about 3 meters. How do I have my physical part of my character follow that? Especially since the animated mesh is a child of the CharacterBody3D root?

I don’t know exactly how to do it, but look up animation “root motion”.

I think this video might be helpful:

1 Like