Hi all. The unity tutorial below demonstrates how a basic hopping animation can be made with root motion -
The sprite moves in the x/y axes a very specific amount with each hop.
When I recreate something similar with the “hop” as the sole state/looping my object moves in a predictable fashion. My issue occurs if there is an “idle” state that transitions to the “hop” state (say if “hop” is triggered using the inbuilt trigger function when a key is pressed). In this setup there is inconsistent movement. In particular, the animation/movement appears to finish too early or too late, such that over multiple hops the object is higher/further forward than it should be at the end of each hop.
See screenshots for an idea - Subsequent hops - Album on Imgur
My feeling is that it might be to due with the transitions but I’ve tested without luck so far.
Transition into hop - no exit time, transition duration 0s (note the idle animation does not change the x/y position)
Transition out of hop - Exit time enabled - set to 1.0, transition duration 0s
A solution would be to NOT use root motion and translate the object with script then animate on top, however I would prefer root motion for its ease of setting up movement.
Any help would be much appreciated.