Mecanim Tutorial Animator, Character Controller gravity issue during JumpDownRollRun

So I too am going through the Mecanim tutorial and have come across an issue with the animator not recognizing gravity during the JumpDownRollRun animation. The capsule collider seems to be working with gravity (as seen in screen shots attached) but my avatar (Animator) is not staying with it’s collider.

I’ve worked with the curves (below) in the JumpDownRollRun animation but to no avail…

Got to be something with gravity in the “BotCtrl.cs” maybe?

I’ve seen a similar but different post here (closed now):
http://forum.unity3d.com/threads/149218-Mecanim-Animator-and-Character-Controller

Hmm, I have a similar issue. I’m running through the tutorial now and coming across the same thing, except that my collidor isn’t updating either. I can see that the collider’s centre and height values are being updated but it’s simply not being pulled down by gravity until the animation is over. Wha?

same happens when char runs off of another ramp, it floats for a while before gravity is applied…

I had an issue where when I would run off a ramp or cargo container, I’d stay at about that height until I stopped; at which point I’d fall. If I turned while running in the air, I’d slowly head for the ground.

Turns out I was originally using a copy of the tutorial files that is from an earlier version of the tutorial video. I first realized I had the wrong files when I was searching for MatchTarget to look at the line in the code and could not find it.

Make sure you have the files from “http://video.unity3d.com/video/7362044/unity-40-mecanim-animation” which points to “http://files.unity3d.com/will/MecanimTute.zip”. This file is 147mb, slightly larger than the 143mb one I first tried.

On the Finished version of the tutorial scene they provide, the newer tutorial files had that wall of green boxes in front of all three ramps. My original files only had them in front of one ramp.

I hope that helps.

@Socrates, Thanks! that helps. I must have dl’ed the tutorial files from the asset store or something.

I don’t see the jumpdownfallroll animation any longer that is used in the tutorial. Did you combine the 3 seperate files yourself and add custom curves to the new animation to get that to work properly?

Thanks for the help!

Jimmy3d: I finished the tutorial with the original files before realizing I had the wrong set, so I didn’t work with the updated files very much. (I went looking because of the missing script and the weird hovering on running off ramps.) Looking at the updated files, I don’t see a combined fall, jump down, and roll animation already assembled either.

Unity posted an updated mechanim animation tutorial here:

they actually create new states for each of the fall, jump down, and roll animations and then transition them through the animator window. Also using raycasting and that match target you mentioned to modify the capsule controller size and gravity.

I’m so happy to see an updates video!

cheers,

I have had some luck setting my animations y root position to looped and based on feet.