So here's the code
var enemy : GameObject;
function Start ()
{
while (true)
{
Instantiate (enemy, Vector3 (Random.Range (-20, 20), Random.Range (-20, 20), transform.position.z),
transform.position, transform.rotation);
yield WaitForSeconds (3);
}
}
and here's the error
Assets/Enemy/spawning.js(6,29): BCE0023: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(UnityEngine.GameObject, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Quaternion)' was found.
Any help?