Hey! I have a GameObject with a GUI script attatched to it, and i need to print the selected objects name (Useing raycast to select object), so i need to access the selected GameObject's name from the GUI script. Is this possible?
asked Oct 26 '10 at 08:16 PM
You can just use name, e.g. :
will print the name of the gameobject the script is attached to
You can use that like this to find out the name of the object under your cursor in c#:
Try this, haven't tested it myself and not sure if a string would be returned but it's worth a try.
answered Oct 26 '10 at 08:29 PM