When it comes to unity’s casting with Object to GameObject, it continues to elude me. For example:
//if the phase isn't done, run its procedures
if(!phaseList*.GetPhaseDone())*
-
{*
_ phaseList*.Run();_
_ GameObject nextSpawn = phaseList.NextSpawnObject();*_
* if(nextSpawn)*
* {*
* GameObject newSpawn = Instantiate((GameObject)nextSpawn,new Vector3(0,-20,0),Quaternion.identity);*
* }*
* }*
NextSpawnObject returns a GameObject prefab as its definition. The variable is a GameObject and everything within the function. However, I continue to get an error for trying to cast it with the Instantiate function. It won’t work without the cast, either. What could be wrong?