- Home /
Distance travelled by a character is limited (capped) when using Mecanim
I'm trying to use Mecanim to animate my character instead of using the old legacy system. Mecanim needs the animation to have Root Motion, so the animation is already moving forward and we can specify the speed of this motion in the animation state.
I have followed the tutorial on the new Learning center. However, no matter how much speed I try to add, the amount of distance travelled by my character is more or less the same.
Video showing that the distance travelled is limited!
I created a video to show you what I mean. In this video, I'm using Mecanim animations provided from the free Project Stealth available for Unity 4.1. The version of Unity that I'm using is 4.1.2f1.
My question is how do I modify the amount of distance travelled?
Why is the amount of distance travelled by my character is capped (limited)?
Here's a screenshot of my Blend Tree locomotion state (Walk threshold is 1.5 and Run is 5.6)
And this is the condition on the state transition between Idle and movement
Here's a screenshot of my animation controller
Here's a screenshot of my character's inspector
P.S: PlayerMovement Script is unchecked on purpose. I want to see the character run by itself forward. Even if I enable PlayerMovement, then when I move forward using keyboard input, the distance travelled by my character is still limited.
Please help! I don't know what's wrong any more!
$$anonymous$$aybe there's an issue with your physics components (rigidbody and capsule collider). To isolate just the animation, try previewing it on your character. Select the animation, drag your character into the preview area at the bottom of the Inspector panel, and hit play.
Answer by willgoldstone · May 01, 2013 at 02:16 PM
Hi there, this could be a couple of different things, and despite your high detailed post I'm still not totally sure which it is.
From the video link, it appears to be a scale issue, though often with a scale larger than it should be, graphically it should display wrongly to show you this. Is the character roughly the height of two cubes? (2 units tall) This is pretty standard for a humanoid.
Next thing to ask is where you're drawing the animation from - is it your own or some animation data you've downloaded. If so, where from? We'd also need to see your code so please paste us it or link to pastebin.com.
If you want to prefab and export the character and its dependencies and upload them somewhere, i'm happy to take a look at this for you.
Our $$anonymous$$ecanim $$anonymous$$m just pointed out that you haven't checked 'Animate Physics' in your Animator - as you're using a rigidbody, this is important. Try that and let us know.
Thanks for your reply Will. The problem is the scaling indeed. I'm using the animations provided from the free S$$anonymous$$lth Project provided by Unity. The animations have the scale factor set to 0.01. And your character (ethan) in the S$$anonymous$$lth project is also set to the scale of 0.01. So when I scaled my character to 0.01 scale factor, the character started running normally. Now, for my character, putting 0.01 as the scale factor makes my character very tiny in my scene.
I tried changing the scale factor to 1 for your animations but that made the model overlap between its parts (legs and hands are overlapped in the chest area ... very disturbing lol).
So how do I use your free mecanim animations for scale factor of 1 rather than 0.01 ?
Ok, I have solved it! You need to re-apply the rig for your model avatar by going to the Rig tab and choosing copy avatar from model then choosing "None" and apply changes. Then, choose create from this model and hit apply. I found the solution in a forum post here by Alf203. The screwed up model upon changing scale factor with mecanim seems to be a bug