Lets say I have a script that is a component of a GameObject. How can the script go about getting the name of the GameObject it is a component of?
For example, could I do something in the script like
GetComponent().name or something?
Thanks!
Lets say I have a script that is a component of a GameObject. How can the script go about getting the name of the GameObject it is a component of?
For example, could I do something in the script like
GetComponent().name or something?
Thanks!
Just “name” is fine.
function Start () {
print (name);
}
–Eric