Answers for "setting the parent of a transform which resides in a prefab"

C#
0

setting the parent of a transform which resides in a prefab

//You might have tried to set the transform of the prefab as the child
//instead of the transform of the object you instantiated by accident.
GameObject name = (GameObject)Instantiate(namePrefab);
namePrefab.transform.parent = nameOfParent.transform; //Wrong
name.transform.parent = name.transform; //Correct
Posted by: Guest on June-21-2020

Code answers related to "setting the parent of a transform which resides in a prefab"

C# Answers by Framework

Browse Popular Code Answers by Language