I’m having a really strange problem where I’m trying to set gameObject.SetActive (false), but the GameObject remains onscreen. I used a print statement to determine that this part of the code is reached while running the game, so it’s not that the code isn’t being executed.
Also, replacing gameObject.SetActive (false); with Destroy(gameObject) does work, and the GameObject is removed from the screen. What could be causing this and how do I fix it?
I’m using C#, if that’s relevant.