One thing I noticed so far on rigged vs mecanim. Is mecanim forces the object to whatever values are in the keyframes. S...

One thing I noticed so far on rigged vs mecanim. Is mecanim forces the object to whatever values are in the keyframes. Seeing here looks like on the rigged character he can just 'move forward' I plan on starting small for my first game and have the main character be a primative, like a sphere. Will I have to rig a sphere to get it to roll forward?
  • Jonathan Gonzalez(jgonzalez) replied
    With rigged characters like humanoids you could indeed "use root motion" which is supposed to move the character similarly to the animation. If you have a ball you wouldn't need to use animations at all to move it forward. You could just move the ball forward by script using something like Transform.Translate : https://docs.unity3d.com/ScriptReference/Transform.Translate.html or you could also just use physics to apply a force to a rigidbody on the sphere. Even easier, you could just use the Characters package which has character controllers already built in.
  • andrewm2211 replied
    Cool thanks for the tips on moving the ball. But I'm still not clear on what's happening with the humanoid animation vs the mecanim stuff in the previous lesson that allow him to travel. What I mean is that in this video the character walked forward, and then when you changed the value to 0, he went back to idle in his new postion. In all the mecanim tutorials the cube would snap back to transform values that were used in the animation. Trying to understand the difference between the two.
  • Jonathan Gonzalez(jgonzalez) replied
    Are you referring to the walk parameter? Remember that's based off the vertical axis. So when you press the W key or the up arrow we're increasing the vertical axis value above 0. The transition towards "walk fwd" happens when it detects a value greater than 0.1 and since we have "use root motion" enabled it starts moving forward when walking. When using the cube you'd specify specific positions/rotations/etc to animate the object. So if I have two sets of keyframes, one starting off at position x of 0 and the second set at position x of 1 it'll move forward to that x position of one each time. You could use the exact same setup for the rigged character for the cube. When the walk parameter is above 0.1 we could transition into a second cube animation. The parameter has nothing to do with the actual movement of the object it's just a value used to determine when the animation will transition. The animation itself determines how/where it's going to move. Hope that makes some sense. Parameters just provide the condition of when to transition.
  • andrewm2211 replied
    My question isn't really about the parameters. I noticed when this character walks forward, he walks a certain distance. and when he stops, he goes back into the idle state in that spot. I don't know how to do that. because if I make an idle state of my sphere sitting still. Then a 'forward' animation of it rolling forward. it will move forward, and then snap back into it's original position where the idle state was created. I want to be able to make something move across the plane like this guy, and not snap back to the 0,0,0 position everytime it goes back to idle
  • Jonathan Gonzalez(jgonzalez) replied
    This is turning into a bit of a long discussion, would you mind posting this on the community? I get what you're saying, it'll be easier to explain there with some more graphical elements to help out a bit.
  • andrewm2211 replied
    no problem, http://community.cgcookie.com/t/how-to-get-a-character-to-travel-when-animating/6447 thanks