How to end time/score and show in new scene

Hello all,

I’ve been working on unity for a few weeks now and i’m a little stuck on how to get my time/score to stop when the player has destroyed the 6 tagged targets in the game.

I want it to stop the timer and score whilst ending the scene to then display an end game scene with the results on that page.

How would I end this when all targets are destroyed and also then load a new scene with the results? (I have looked into the “DontDestroyOnLoad (transform.gameObject);” but can’t figure out how to set this up.

Help much appreciated,

Ben

You need a script say “ScoreKeeper” that has score variables. Also at Start() or Awake() you add DontDestroyOnLoad( this.gameObject ). Then attach the script to an empty gameobject. Now you have your score available to you throughout your game.