Question by
cumulowinter · Mar 27, 2018 at 10:22 PM ·
instantiateprefabbooleanbool
Check a bool from a prefab?
I have this inventory system where it converts the gameobjects to strings in an array, and destroys them, to later instantiate their prefab again when dropped out of the inventory. I would like to be able to check if a bool inside the prefab is true or false
void Update()
{
if (sylladex [0] != null) {
slot [0].sprite = Resources.Load<Sprite> (sylladex [0] + "_sprite");
if (GameObject.Find (sylladex [0]).GetComponent<ItemManager> ().usable)
;
{
Debug.Log ("working");
}
}
}
i know it's not working cause there's no gameobject for it to find, but what could i write in the place of GameObject?
Comment
Your answer
Follow this Question
Related Questions
How to change the Bool for only a single prefab GameObject creating with Instantiate? 2 Answers
I get an error message every time i run this script? Any ideas? 0 Answers
Static bool 1 Answer
My code is instantiating many prefabs, i only want one. 1 Answer
Generating prefabs at origin that are children of moving GameObjects? 2 Answers