Hi. I know this might sound silly... I've read the FPS tutorial and all sorts of tutorials... But when I shoot, the bullet stays at the spawn point of the gun. And you shoot millions of them as long as you keep holding on the mouse button. Here's my script:
public var bulletPrefab : Transform;
public var bulletSpeed : float = 6000;
function Update(){
if(Input.GetButton("Fire1"))
{
if(!bulletPrefab || !bulletSpeed)
{
Debug.Log("[Shoot] 'bulletPrefab' or 'bulletSpeed' is undefined");
}else{
var bulletCreate = Instantiate(bulletPrefab, GameObject.Find("SpawnPoint").transform.position, Quaternion.identity);
bulletCreate.rigidbody.AddForce(transform.forward * bulletSpeed);
}
}
}
Please help!