Im trying to make a Final Fantasy X like battle system. Its a battle system that shows whos turn it is and whos it will be by having a picture array.
1)Every player, npc, and enemy will have the script called “Stats” how do i get the right script from the place?
2)im going to be using a var in “Stats” to populate the array for the turns, am i going to be able to easily manipulate any var in my script. ex. use – or ++
3)once there in the array and they die how am i going to get them out of there.
4)if all my character are in an array can i still access there srcipts.
f you dont know programming at all, i would really suggest following a text book , like “Unity Essentials” to give you an undertanding of how the engine works. It also assumes no knowledge of programming at all.
GameObjects are bags of components, basically. the script Stats is a component, Transform is a component, Mesh Renderer as well etc.
You want to access every GameObject with a component Stats then. The easiest way is to use FindObjectOfType which return an array of the type passed in argument. You can then do whatever you want with those components, like array[3].DoSomething();
However, if you’re having trouble with this, you need to slow down and improve a bit before making Final Fantasy X.