can you change the name of GameObject from script? Not the tag orlayer but the name of the object you would see from the Hierarchy Menu.
3 Answers
3Sure, just set it's name property:
GameObject.FindWithTag("MainCamera").name="MyMainMain";
can you change the name of GameObject from script? Not the tag orlayer but the name of the object you would see from the Hierarchy Menu.
Sure, just set it's name property:
GameObject.FindWithTag("MainCamera").name="MyMainMain";
name is a property of component, being that component inherits from Unity's Object, so you don't need the gameObject.
– JessyYeah I was just out gathering more info about it when it struck me.
– Statement