Sorry for such a noob question, but I’m just starting to use characters in my work…
I’ve animated a character in Maya and am able to chop it up into the appropriate ranges. I’ve created a Character Controller and am using the following script (copied straight from the Manual):
function Start ()
{
// Set all animations to loop
animation.wrapMode = WrapMode.Loop;
// except shooting
animation["shoot"].wrapMode = WrapMode.Once;
// Put idle and walk into lower layers (The default layer is always 0)
// This will do two things
// - Since shoot and idle/walk are in different layers they will not affect
// each other's playback when calling CrossFade.
// - Since shoot is in a higher layer, the animation will replace idle/walk
// animations when faded in.
animation["shoot"].layer = 1;
// Stop animations that are already playing
//(In case user forgot to disable play automatically)
animation.Stop();
}
function Update () {
// Based on the key that is pressed,
// play the walk animation or the idle animation
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1)
animation.CrossFade("walk");
else
animation.CrossFade("idle");
// Shoot
if (Input.GetButtonDown ("Fire1"))
animation.CrossFade("shoot");
}
Sure enough, all goes well, when I push ‘w’ it calls up the walk animation; but the character just walks in the air - he doesn’t actually move. I’ve brought Lerpz into the scene and he takes off when using the CharacterController script and CharacterAnimation scripts included with that tutorial.
I’ve checked to make sure that the character isn’t intersecting with anything in the scene (I’ve put him way up in the air), but on play, he stays stuck. Any suggestions?
[/code]