How can I add a 'final score' to next scene?

I’ve created a new ‘win screen’ scene based on destroying the boss in my game, but what I really want to do is have the final score from the game scene shown on the ‘win screen’.

I’m not sure where to really start with it though?

Can someone offer some advice?

Hi Liam,

You could take a look at the PlayerPrefs in the Unity API.

I’m looking into them at the moment, but struggling to link it with the code that we learnt through the Argon Assault section.

I’m trying to put it through setting the score as an int and then calling the int in another script to display it but not really 100% sure how to make it actually display on the final scene.

Would I need to add the script calling the int to a text UI?

Nevermind! I worked out how to do it using PlayerPrefs!

I set the int on the script that displays the score on the game scene, then made the final score script on a text object on the win screen calling the int. I essentially forgot to add ‘ToString()’ to turn it from an int into a string.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms