0 votes

Hi everyone!

I'm working on a 3D third-person shooter game and while I'm starting to learn the ins and outs of AnimTree, I can't wrap my head around actually applying the rootmotion transform gathered in my particular instance.

My setup, fully credited to Pemguin005's Soulslike Third Person controller, is to have a "Player" node which has an "ActorMesh" node attached to it - the player is the actual physical movement and logic and does not rotate while the ActorMesh conveys the current direction, actions etc. by rotating towards the direction angle on their Y axis and animating appropriately.

The AnimTree in my case is a child of the ActorMesh along with their AnimPlayer, but both are easily accessible from Player using a "ActorMeshAnimTree"/"ActorMeshAnimPlayer" variable.

I was wondering if it's possible to gather the root motion transforms from ActorMesh's AnimTree and apply it to Player's position based on ActorMesh's local rotation - the idea being that if ActorMesh does an attack animation with Root bone motion, Player would be moved in whatever direction is forward, backwards, right or left for ActorMesh.

Thanks to Pemguin005's Soulslike Third Person controller and a few "move in direction" suggestions found online, I've ended up withvelocity = (child_node).global_transform.basis.z.normalized() * amount to give me a great little function to trigger a quick push forward to emulate rootmotion, but it'd be amazing to have the full breadth of Rootmotion available to use on attacks.

Thank you very much for any suggestions!

P.S. I don't have the programming know-how to make a proper suggestion but to the Godot devs, a section under the AnimationTree's Rootmotion tab to toggle automatically applying the gathered Rootmotion transform value to another Node's local or global transforms would make that whole system infinitely more usable IMHO!

Godot version Godot 4 Beta 4
in Engine by (16 points)
edited by

Please log in or register to answer this question.

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.