Search Unity

Y-Axis Root Motion not performing as intended

Discussion in 'Animation' started by Xaqqa, May 29, 2021.

  1. Xaqqa

    Xaqqa

    Joined:
    Jul 27, 2017
    Posts:
    1
    Hey, hope anybody reading this is having a great day!
    So this is my first proper time using the Animator (after years of using Unity) because I just found it easier to use Timelines prior, but I wanna learn how to do animations properly!

    What I have here is a minecart that animates with Root Motion to go left and right, but my jumping animation doesn't seem to be working. I've keyframed it all correctly, just as I did with the left and right turning animations (which work 100%).
    After a few days of testing to narrow things down, I've come to the conclusion that the root motion doesn't appear to be working on solely the Y-Axis, the rotation keyframes in the animation work as intended, resulting in the minecart just rocking side to side rather than also going up and down.

    I'll attach gifs of both what the animation is supposed to look like alongside gameplay of how it looks when it's broken. But to save people the trouble of getting me to repeat steps, this is what I've tried so far.
    • The root motion isn't being interrupted by any code that's trying to access the same transform variables (I've tried removing any possible code to test this and the results are the same).
    • As this animation was hand-keyed within Unity, I can't simply change the import settings like a lot of other threads have suggested for similar issues.
    • I know that the animation execution code is working fine, as my other animations use practically the same code to execute (everything on the code side is working as intended).
    • I've checked to see if the rigidbody's gravity is keeping the minecart pushed into the ground, but that also doesn't seem to be the case (I've tried making gravity null, alongside keeping gravity the same and forcing the minecart to jump higher, both results were the same and did nothing different).
    • I've tried removing the transitions related to the animation inside the Animator graph to eliminate the possibility that the animation wasn't being allowed to complete (same result, nothing).
    I know this is a wordy issue but I'd be very grateful if anybody could throw any possible solutions into the pile with this one!
    Cheers, and stay safe everybody!
     

    Attached Files: