- Home /
C# - GameObject re-naming itself in runtime?
This could every well be a bug, but I thought it may be worth asking just in case it was just some small thingy-ma-jiggy that i might have accidentally flipped/clicked/switched/tapped/bumped.
In my hierarchy, i have a game object with the name "vendorHandler" and when i run the game, it suddenly changes its name to "cap" (Which I think I accidentally re-named while setting the names of some sprites). Now, however, it just keeps on reverting back to "cap" when I run the game. I've tried duplicating the object, it does the same, i've tried renaming it in the inspector, in the hierarchy, but it just trolls me.
No matter what I do, it just keeps re-naming itself back to "cap". Has this happened to anyone before? and is this a legitimate bug? (Nothing in my script would be re-naming it, i wasn't even sure that was possible, so i'm certain i haven't attempted that in my script)
Answer by OpenXcell-Studio · Oct 17, 2016 at 10:22 AM
open mono development and press ctrl+shift+F
and write cap
and search
you have to find line where it giving gameobject.Name="cap";
O$$anonymous$$G! Thank you, this was driving me insane! haha! I had a variable "displayName" but i'd accidentally typed "name = "cap"" ins$$anonymous$$d of DisplayName. - indie dev life...
Your answer
![](https://koobas.hobune.stream/wayback/20220612094809im_/https://answers.unity.com/themes/thub/images/avi.jpg)