I use the following code to spawn some Objects in my project:
if (s == side && filled == false)
{
var n : GameObject;
n = Instantiate (GameObject.Find(“GameMaster”).GetComponent(GameMaster).selectedTile, transform.position, Quaternion.identity);
n.transform.parent = GameObject.Find(“Ghosts”).transform;
n.transform.eulerAngles = transform.eulerAngles;
n.GetComponent(Wall).giveSegment(gameObject);
Debug.Log(transform.rotation);
}
In Unity 4, this worked perfectly fine but since converting to Unity 5 there is a problem. It still spawns the object, but doesn’t spawn its child objects, like the 3d model. If I just drag the prefab into the scene it works, it just seems like the instantiate is broken somehow.