So i’m trying to use a script to control my various weapons’ fireRate, ammo, etc. To do that, I want the script to find the name of the object it is attached to. How do I accomplish this?
It’s as simple as:
string objectName = gameObject.name;
So i’m trying to use a script to control my various weapons’ fireRate, ammo, etc. To do that, I want the script to find the name of the object it is attached to. How do I accomplish this?
It’s as simple as:
string objectName = gameObject.name;