Could someone help me with this script:
var projectile : Rigidbody;
var speed = 20;
function Update () {
if ( Input.Input.GetMouseButtonUp(0)) {
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
Destroy (clone.gameObject, 3);
}}
Problem here it is that this script create a lot of this objects but i want only one in 2 seconds.
Sorry for bad english
↧