Question by
BusaniX · Sep 17, 2019 at 09:19 PM ·
c#gameobjecteditorruntime
GameObject clone name not updating on editor
Hello,
I'm using Instantiate() to make clones of a prefab. However when I rename them using GameObject.name it doesn't get updated on the editor. I can even print() the name and it will show up but on the editor it's still "prefab name (clone)". Any help? Thanks!
void GenerateLevel()
{
Room room = Instantiate(roomPrefab).GetComponent<Room>();
room.gameObject.name = "new name";
}
Comment
Your answer
Follow this Question
Related Questions
Can i chose game objects as parts of an array in a script ? 1 Answer
How to automatically add a script component to a generic gameobject in the editor? 1 Answer
SetActive is just working if i press twice in the first time 2 Answers
How can I put buttons on a Cube? 0 Answers
Disable mouse click on gameObject 1 Answer