Its such a basic script yet I get that error whenever I press the flare key. I have set the flare in the inspector to a prefab and the player to the player’s capsule, I have even tried using various different prefabs for the flare, but to no avail. Any ideas? The error is on the Instantiate line.
var player : GameObject;
var flare : GameObject;
function Start () {
}
function Update ()
{
if(Input.GetButtonDown("Flare"))
{
Instantiate(flare, player.transform.position, player.trafnsform.rotation);
}
}