Hello!
I’m trying to implement a death score system that shows, at the win screen (Last scene in-game), how many times you died during the game.
My death count text is disabled during the Level Scenes and I want to enable it when the last scene is loaded, but I can’t get the code for it to work, because the death count system is in a different script than the scene loader script.
I’d love for some insight on what to do to get a workaround… Thanks for the help!
A gameobject that can persist is what you want and don’t destroy unload I believe
I can make that work, but it’ll show the Death Count on the Level Scenes, and I wanted it to only be visible on the last scene, the “Victory Scene”
You want the variable deathCountto persist not the ui. Then ontjr victory screen your ui can pull that data
Ohh, let me have a go at that and i’ll tell you in a bit if I got it working!
I managed to make it work! I turned the DeathCount variable into a public static and finally was able to access it from another code! It’s working perfectly, thank you for the help
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.