How do I Effect a whole Array of GameObjects' Scripted Boolean?
Okay, basically what I have going on is i need to set a bool on a script, that is attached to a prefab(gameobject). Problem is the script is on every prefab that the player can use. So I have to save myself future trouble when the player does end up having another said prefab(gameobject) with that script. So boiling it up I need to set a bool on a script that is attached to the array of gameobjects.
Here is what I figured it would be like, well for one object but of course I need to able this to a whole array:
saidObject.GetComponent<SaidScript>().saidBool = false;
//With an obvious else doing
saidObject.GetComponent<SaidScript>().saidBool = true;
If the bool is either going to be true for all objects or false for all objects, you could use a static variable
Your answer
Follow this Question
Related Questions
PLEAASEE I NEED HELP!!! How to turn Mesh Renderer of cubes on and off by pushing buttons? 1 Answer
How to change the Bool for only a single prefab GameObject creating with Instantiate? 2 Answers
Need help to generate a random assortment of 4 buttons - C# 0 Answers
Enabling & Disabling Script via On Click 1 Answer
Script Variable not transfering 0 Answers