I have a script that needs to change the value of a bool when a certain phase of the game begins. Usually the various Game Objects on which this script is found are disabled and, although I use an instruction to change the value it does not change. How can I do?
Setting a variable on a disabled object works exactly the same as setting it on an enabled one. There is probably something else wrong with your code.
2 Likes
Huh, Antistone is right. Didn’t figure that it would work without it being active but it did. I agree with Antistone, I’d give a second look at your code.
1 Like
Check if you have errors (red stuff in the console). Also how you do it exactly? I’m asking, because for example the GameObject.Find method only find active GOs…
If you post some code, please use the code tags. You can find it here in the toolbar when you’re writing your answer.
1 Like