Hi, I’m kind of having a weird problem. All i’m doing is shooting a projectile from the first person camera of the player. I created a prefab which was a red ball and then dragged it into my script that sits on the camera. It works fine, but I get an error that says, “UnassignedReferenceException: The variable theBullet of ‘Shoot Script’ has not been assigned”
#pragma strict
var theBullet : Rigidbody;
var Speed : int ;
function Update ()
{
if (Input.GetMouseButtonDown(0))
{
var clone = Instantiate(theBullet, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3(0, 0, Speed));
Destroy (clone.gameObject, 3);
}
}