Hi, in my script Im trying to get/import a value from another file. My game is supposed to be a 3rd person, free view kind of game, where you can control some units, access inventory, see stats etc. Im new to C# i have programmed php for a long time, but find c# has a steep learning curve. i can’t quite grasp my head around all these types and functions. so i have turned to this community because i have found many great answers here.
This picture should explain what im wanting to do.
What im trying to achieve is:
- Select the unit, get the units name, and store it(until deselcted)
- Store the name so its accessible to all scripts i have that need to target the gameobject.
- retrieve the gameobject name, and handle it as a gameobject(i guess gameobject.find(name) would be suitable)
I have tried so many different things, but my novice experience with unity and c# holds me back.
How would i be able to achieve what the image displays?