I am currently trying to instantiate a Prefab when the player collides with a GameObject. The code I have for this is:
public var compass:GameObject;
function OnTriggerEnter(collisionInfo:Collider){
if(collisionInfo.gameObject.tag == "map"){
Instantiate(compass, Vector3(786,32,550), Vector3(0,0,0));
}
}
However, upon running the game, I get this error:
No appropriate version of ‘UnityEngine.Object.Instantiate’ for the argument list ‘(UnityEngine.GameObject, UnityEngine.Vector3, UnityEngine.Vector3)’ was found.
But, when I try to use the Instantiate function with just one parameter (the GameObject), then the game executes. It is only when I add the Vector3 parameters that I get the error.