- Home /
 
Quaternion.identity problem at random spawn
There is a code which i wrote for handling random spawning of the desired dot but unfortunately, debug log says
Assets/Scripts/Alghoritmic/DotSpawner.js(30,20): BCE0023: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(System.Type, UnityEngine.Vector3, UnityEngine.Quaternion)' was found.
Actually, I didn't mget anything from this error. What would be problem ?
pragma strict
 static var levelNumber = 1;
 
 var dotId : int;
 
 var dotObject = GameObject;
 
 function Start () {
         
         //We'll attend an id to our objects later
         dotId = 0;
 }
 
 function Update () {
 
     //Seperate function for hold
     startCreating();
 
 }
 
 function startCreating () {
     
     //Hold for 500ms
     yield WaitForSeconds(0.5);
     
     //Spawning Border (According to "Space-to-Screen" border
     var spawnBorder = transform.TransformPoint(Random.Range(-2.3,2.3), Random.Range(-4.0,4.0), 0);
     //Spawn dotObject somewhere at spawnBorder
     Instantiate(dotObject, spawnBorder, Quaternion.identity);
 
               }
P.S. I've tried using dotObject as Transform and GameObject. Still same thing.
Answer by KillMobil · Jan 24, 2015 at 04:17 PM
judging from the error it seems that you feeding the Instantiation function with a "System.Type" I am guessing that the dotObject type has not been properly defined.
try define the object like this:
  var dotObject :GameObject; 
Your answer