***First off:***
**I'm from Germany sorry for my english**
----------
i've been written a Script to shoot a single Prefab.
But now i want an automatic Gun.
sooooo......
Can Anybody help me to make this shooting Script 'automatic' ?
Here is the Script:
var Projectile : Rigidbody;
var ProjectileSpeed : int = 10;
function Update () {
if (Input.GetButtonDown("Fire1")) {
var clone : Rigidbody;
clone = Instantiate(Projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection (Vector3.forward * ProjectileSpeed);
}
}
↧