Hey Everyone,
I’m really at a loss with how to fix this issue. I’m trying to activate GUI elements based on collecting the objects in the scene. However, the following code seems to the main culprit creating this error:
The tutorial I’m following uses this code to deactivate the game elements, in order to activate them after collecting the right objects, displaying them on the screen in real time. Whenever I comment out this section of the code, the game works except for the canvas displays all the visual elements that I’m trying to activate.
Is there a better way to dynamically deactivate/activate GUI elements that avoid returning a nullreferenceexception error?