What is actually driving the character forward in the Mecanim tutorial?

After looking at the script for the Mecanim tutorial where you set up the robot, I am unable to grasp how the rigid body knows to move forward. Previously I had been using character controllers to move my characters, and that requires code telling it to move. However, I don’t see that code in this tutorial, just that a speed parameter is being passed to the animator. The rigidbody isn’t even referenced in the BotControlScript, which is where the locomotion controls are. Is anyone able to shed light on this?

The tutorial: http://video.unity3d.com/video/7362044/unity-40-mecanim-animation

That is called root motion, you can find info on the docs.

Thank you for that. I was able to find a little about it here: Unity - Manual: Root Motion - how it works

However, how can I actually tell how fast a character is moving? It’s very important that all of my characters (humans and creatures) have a standardized speed of measurement. When using a character controller, this is easy since you define how fast it is. With the root motion system it seems as if it’s defined by the animation itself.

Different leg lengths will result on different movement speed from the same motion. Pretty clever system.
Mecanim seems to addapt to avoid foot sliding issues. Mecanim staff can explain it better than my assumptions. You can simply not use this feature if you feel so and move the character with standard CC code.
Just check “Bake into pose” and it will stop moving by root motion.

I do like that it really helps fix the “sliding” issues. Is there a way that I can make my human character run the exact same speed as a dog character using root motions? Or do I have to script that speed manually for it to have precise measurements? Basically, I need every character and creature (human, or animal, or floating ghost, or whatever) to have the exact same movement speed.

I don’t know the answer to that :wink:
Maybe you can adjust Animator.speed for each Avatar to make each one match the average speed you need?
shorter leg needs more speed, big guys run slower, etc… I think that could work.
You would need to make sure Animator.speed does affect root motion though, I dunno.

Animator.SetTarget() may be of some help too.

Open BOT CONTROLS in robot ANIMATOR component.