Play animation when shooting?
var bullet : Rigidbody; var speed = 20;
function Update () {
if (Input.GetButtonDown("Fire1")) {
//play animation "shoot"
var clone : Rigidbody;
clone = Instantiate(bullet, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection (Vector3.forward * speed);
}
}
Comment
Your answer
Follow this Question
Related Questions
Help me to make a delay when shooting 0 Answers
Shooting animation and bullet generation issue 0 Answers
animation plays when game starts. game story intro. i need help 0 Answers
Instantiating object at wrong location, Unity bug? 0 Answers
How to let animation play to the end before playing the next one using button 2 Answers