Hi there, I have this bit of code:
Debug.Log (spawnedObj);
if(spawnedObj == null)
{
CreatePosition();
spawnedObj = Instantiate(prefab,spawnPos,Quaternion.identity) as GameObject;
}
The object is spawning, however when I debug spawnedObj, it’s returning null and thus constantly instantiating this object.
What have I done wrong?
Thank ye