- Home /
Can I make character movement entirely with Mecanim's root motion?
I'm designing a 2.5D platformer for school project. I already have utilized root motion for moving on x axis but struggle with getting y-axis root motion to work properly. My idea was to animate falling, jumping, ledge grabs, ledge idling, wall sliding, wall jumping and basic running with root motion only without scripting it. I just set parameters in script for the animator. So is this possible? And if so do I need rigidbody2D for the character gameobject?
Basically, yes, this is possible. You would most likely need to create two movement state machines, one for climbing and one for regular locomotion. The movement itself would then be applied via root motion (if you set it up correctly, that is). "Just setting parameters for the animator", however, isn't as trivial as you make it sound, especially climbing does require quite a bit of effort to get right when to feed which parameter to the animator.
So the rigidbody isn't necessary unless I do some kind of ragdoll at some point?
As for the climbing, I'm only gonna add ledge grab and climb up while hanging on the ledge... Not necessarily ladders or anything like that.
I just fiddled around and noticed collisions would be a porblem. How do I make the player respect physics without gravity being applied?
For the ledges I use colliders ongameobjects with tag "ledge" to trigger grab animation. Only problem so far is y-axis motion up and down. I have falling animation that has the root motion for falling down and a jumping animation that has root motion for up. gravity makes my jumps fall short and falls stretch too long.
You'd need a character controller so gravity would have an effect. This also conveniently lets you check if the character is grounded, allowing you to play a fall animation if it's not.
Your answer
Follow this Question
Related Questions
How does the Animator drive Rigidbody with root motion (in detail)? 1 Answer
Using root motion scripting for specific animations 1 Answer
Animations blending in weird way (maybe something to do with root motion?) 0 Answers
Moving Character to exact position using animation. 0 Answers
Apply Root Motion with Animator and Animation Made INSIDE Unity 0 Answers