Hi, I’ve been spending the last two days trying to figure this out (and yes, I tried the answers section, I asked several variants of the question and received no answers and I don’t have time to hope someone will dig my question up)
In short, a friend gave me a public function to finish. When the function is called, it defines an int called symbolNum. the script then finds the gameobject with the same number as symbolNum, and then toggles a bool. symbolNum is not defined in initial script though.
A separate script is supposed to give symbolNum its value. Basically, it’s an inventory system that, upon finding an item, will give symbolNum its value, triggering the first script to find and toggle the corresponding item as picked up. Problem is, I have no idea how to do that. I’ve tried using GetComponent, but all I can do is find the entire first script (I’m only working with part of it) and some of the predefined variables in that script. I think it’s because symbolNum is not defined at the beginning of the script, and instead inside the brackets at the beginning of the function. Can anybody help me? I can’t post the code because it apparently becomes a massive wall of some asian characters when I post it here. Thanks in advance!