Hi, Ive been working on an FPS game and the script did not work, when i load the script it asked me for the API update and then if i press cancel there is always an error. Can someone please help me?
Here is the script.
var Bullet : Rigidbody;
var Spawn : Transform;
var BulletSpeed : float = 1000;
var fwd : Vector3;
function Start ()
{
}
function Update ()
{
fwd = transform.TransformDirection(Vector3.forward);
if(Input.GetMouseButtonDown(0))
{
Fire();
}
}
function Fire()
{
var bullet1 : Rigidbody;
bullet1 = Instantiate(Bullet, Spawn.position, Spawn.rotation) as Rigidbody;
bullet1.Rigidbody.useGravity = false;
bullet1.Rigidbody.AddForce(fwd * BulletSpeed, ForceMode.Impulse);
}