September 2011
Beginner
408 pages
9h 52m
English
Let's do exactly that! We'll create a new Script, and use what we already know about following the mouse to snap the player character to our mouse movement. Then we'll tell the character which animation cycle to use when he's moving around.
Scripts and dropping your new script into it.var lastX:float; // this will store the last position of the // character var isMoving:boolean = false; //flags whether or not the player is // in motion function Start() { animation.Stop(); // this stops Unity from playing the character's default animation. ...
Read now
Unlock full access