Hi can someone help me with the script
I want like when i press “Fire1” i will drop C4 but it waits like for a 3 seconds for animation that i made to finish then drops C4
“Like its tiping the code when it’s finish it will drop”
var bomb : Transform;
function Update() {
if(Input.GetButtonDown("Fire1")) {
animation.Play("C4");
yield WaitForSeconds (1) ;
bomb.parent = null;
bomb.rigidbody.isKinematic = false;
bomb.rigidbody.velocity = rigidbody.velocity;
}
}
function FixedUpdate () {
rigidbody.AddForce(Vector3.forward);
}
But it doesn’t work i press “Fire1” and nothing happents. Help please ![]()
Thank you. ![]()