Home > Net >  How to Object By name And assign the parent
How to Object By name And assign the parent

Time:06-28

I have some objects and I want to grab them Using C# and modify their Properties. I know only the name of the Objects. This will allow me to assign the parent and much more

CodePudding user response:

to Find an object in unity and assign a parent you can use

GameObject loadedBanner = GameObject.Find("objectName");
loadedBanner.transform.SetParent(parent);

Visit Documentation for more https://docs.unity3d.com/ScriptReference/GameObject.Find.html

  • Related