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?
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?
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.
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.
@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?
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.
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.