Can anyone help me with this script. When I fire the weapon, a bullet sticks in position above ground. What is happening? Do I need an extra script for the bullet?
// Instantiates a projectile every 0.5 seconds,
// if the Fire1 button (default as Ctrl) is pressed.
var projectile : GameObject;
var fireRate : float = 0.5;
private var nextFire : float = 0.0;
function Update () {
if (Input.GetButton ("Fire1") && Time.time > nextFire){
nextFire = Time.time + fireRate;
var clone : GameObject =
Instantiate(projectile,transform.position, transform.rotation) as GameObject;
}
}