I’m trying to get a bullet to spawn at the location of my game object called “BULLETSPAWN” with the same rotation. I’m trying to use the code:
var bulletPrefab : Transform;
function Update () {
if(Input.GetButtonDown("Fire1"))
{
var bullet = Instantiate(bulletPrefab,GameObject.Find ("BULLETSPAWN"),Quaternion.identity);
}
}
But I get the error:
Assets/BULLETSHOOT.js(13,28): BCE0023: No appropriate version of ‘UnityEngine.Object.Instantiate’ for the argument list ‘(UnityEngine.Transform, UnityEngine.GameObject, UnityEngine.Quaternion)’ was found.
Any suggestions?