lib-unity-tutorial-walk-Assets-Standard-Assets-Scripts-FPSWalker.js / js
function Start() { //set all animations to loop animation.wrapMode = WrapMode.Loop; animation.Stop(); } function Update () { if( Mathf.Abs(Input.GetAxis("Vertical")) > .1) { animation.CrossFade("walk"); } else animation.CrossFade("idle"); } @script RequireComponent(CharacterController)
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.