- Home /
GameObject.name to string
i simply want to conver a object name to string so i can use my variable that is a string to be the same as the name.....
var Ome:String;
Ome=gameObject.name;
doesn work i tried
var Ome:String;
Ome=gameObject.name.ToString();
still not working...
I don't remember what name is a property of, but try transform.name.
Answer by Daten · Nov 23, 2012 at 09:28 AM
Try gameObject.transform.name;
HAHA!!! thx any way...i found why the moment i posted it but i dont know how to delete the post...so sorry thx anyway... because i used it in a GUI so the problem was quite deferent
Answer by Reizla · Dec 19, 2013 at 07:22 AM
Good one! Was looking for it myself. to determine what object of 4 I currently have (numbered in name). Sadly though the (char)"1" converts to (byte)49, but at least that's easily to correct ;-)