Is 2D root motion currently not supported?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gernknod

I’m trying to use root motion on a 2D animation. I can select the animated position as root motion track in the animation tree (e.g. the root bone). However, when I retrieve the root motion transform and try to apply it to my Kinematicbody2D, it doesn’t do anything since the root motion transform is an identity matrix. I guess this is as documented:

If root_motion_track is not a path to a track of type Animation.TYPE_TRANSFORM, returns an identity transformation."

The problem is, TYPE_TRANSFORM is only usable with spatial nodes (which of course my 2D bone isn’t.)

Is 2D root motion currently not supported, or am I missing something?

:bust_in_silhouette: Reply From: Calinou

Root motion is only supported in 3D, not 2D.

As a workaround, you can use a 3D camera in orthogonal mode instead of relying on the 2D engine.

Good to know. I’m planning to do a pixel art game so this is unfortunately not an option for me. Are there any plans that this will be supported for 2D at some point? I couldn’t find any github issues related to it, but I really can’t imagine that noone ever had the need for this.

gernknod | 2021-07-21 10:15

As far as I know, there are no plans to add root motion in 2D. That said, root motion is generally unadvised when you need precision movement mechanics, especially when jumping is involved. Since a fair amount of people are working on precision platformers and the like in 2D, this may explain why root motion in 2D isn’t requested often.

Also, it’s possible to create a pixel art game in 3D using the viewport stretch mode. See Multiple resolutions for more information.

Calinou | 2021-07-22 08:30

That makes a lot of sense. I think I focused a little too much on that root motion topic and forgot the importance of character controls. Thanks for pointing me at the right direction.

gernknod | 2021-07-22 10:18