![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Hanate |
Hello,
I’m trying to use root motion with a 3D model animation, but I don’t manage to make it work to move my character. I don’t know what I’m doing wrong.
What I have done so far :
-
I have an
AnimationPlayer
with a “running” animation. I have anAnimationTree
that enables this running animation by default. The animation is played, my model is moving in the preview. The animation is cycling -
I configured the
AnimationTree
root motion track to be the root bone. Now, my model is running “in place”, not moving anymore (what is expected). When I add aRootMotionView
in the scene, the model is “moving” against theRootMotionView
, as expected. -
I add a script to my scene (which is a
Character3D
), and, in the_process
function, I try to get the root motion position to update my character position, as explained in the AnimationTree documentation.
Here is my problem : $AnimationTree.get_root_motion_position()
always returns me a Vector3(0, 0, 0)
.
The documentation states
If root_motion_track is not a path to a track of type Animation.TYPE_POSITION_3D, returns
Vector3(0, 0, 0)
.
My root_motion_track is configured to be my root bone. I checked it as runtime using $AnimationTree.get_root_motion_track()
, and it points toward my root bone. I don’t know how to check the “type” of the root bone however.
I guess my root motion track is configured correctly, because it works as intended in the scene view. Do you have any idea of what am I doing wrong ?
Regards