Question by
b45h05h4 · Feb 19, 2016 at 11:50 PM ·
gameobjectinstantiateobjectcasting
Object to GameObject casting error c# (from object in scene not a prefab)
Hey,
So here is the normal instantiation code
currentProcess = GameObject.Instantiate (newProcess,
spawn.transform.position,
newProcesses .rotation) as GameObject;
The problem, if this newProcess variable is a prefab it's working fine, however if it's a gameObject from the scene the cast never works! giving just NULL
Any idea how to fix this ??
Comment