How can I change an object’s name with javascript coding? Thank you!
ReferenceToGameObject.name = “New Name”;
Or just name = if this is accessing the gameobject the script is attached to.
Every object has a name attribute, it’s in the docs.
Unsurprisingly, Object.name is the first result when you use the search function.
Thanks alot Dman!!
Jravey, i was actually searching “gameobject” in which you will find it does not exist.
Thanks guys
Sorry, my mistake, it does exist in gameobject, under inherited members… inherited from objects i presume? Anyway, thanks.
Correct, GameObject extends Object.