Tuesday, June 28, 2011

How to play entire animation?

how can i play entire animation when i hit an object or just simply pushing a button



For a button press


if(Input.GetButton("blah")){ do something;


or


if(Input.GetKey("a")){ do something;


OR

function OnControllerColliderHit(hit : ControllerColliderHit) 
 var player = GameObject.FindWithTag("w");

 if (hit.gameObject.tag =="w")
{
     player.animation.CrossFade("sit"); 
 }
 }

No comments:

Post a Comment