I have this script:
#pragma strict
var projectile : Transform;
var shootForce : float = 20;
var fireRate : float = 0.1;
private var nextFire = 0.0;
function Update () {
// Put this in your update function
if(Input.GetKey("mouse 0")&&Time.time > nextFire){
nextFire = Time.time + fireRate;
// Instantiate the projectile at the position and rotation of this transform
var clone : Transform;
clone = Instantiate(projectile, transform.position, transform.rotation);
// Add force to the cloned object in the object's forward direction
clone.GetComponent.<Rigidbody>().AddForce(clone.transform.forward * shootForce);
}
}
and im receiving this errors from Unity:
Can somebody help me?
Thanks!