It looks like you're new here. If you want to get involved, click one of these buttons!
Hello fellow programmers!
Me and a friend is working on a little game for us to learn how to do stuff.
We have a few different scenes (called S1, S2 from now on) and also a Hub where you can access all the other scenes.
In every scene we have a few coins to collect. When you collect a coin we want to disable that coin for that whole playsession, meaning that when we go back to that level that coin will no longer be there for the player to collect. How can we do this?
We have tried doing this:
gameObject.GetComponent<SpriteRenderer>().enabled = false;
But it doesn't work, the Sprite still renders when the player enters the same level again. Anyone got any suggestions? Also, PLEASE don't post the solution straight away, drop a hint instead so we get the learning from it.
Best Regards, O and R