I want to make “shoot” animation being played each time only after bullet shot out. Here’s my script:
private var _animation : Animation;
var Bullet : Transform;
var Speed = 500;
var spawnPoint : Transform;
var Counter = Time.deltaTime;
var RateOfFire = 0.250000;
var target : GameObject;
function Shoot() {
yield WaitForSeconds(0.1);
Counter += Time.deltaTime;
if(RateOfFire<Counter){
var shotRapid = Instantiate(Bullet, spawnPoint.transform.position,
Quaternion.identity);
shotRapid.rigidbody.AddForce(transform.forward * Speed);
Counter=0;
}
}
So how can it be achieved? Thanks in advance for your feedback