Save timer score from different scenes

Im trying to build a game were the player should try and localize sound sources and then time them and save it. Then move on to the next scene and do the same thing but with a different sound. Right know I have a trigger on a gameobject which send the player to the next scene with :

Application.LoadLevel(“level2”);

But I cant seem to get a timer to work in the way that I want to. Can I get some help on what I should look for?

So what you’re trying to do is time the player, but keep adding on to that time across the different scenes rather than start again from 0, correct?

If so, you can just use a Static Variable which will stay the same across all scenes. See this question for an example.

EDIT: @Ajizi after your answer containing more info (not sure why you posted that as an answer though?) I now know exactly what you are looking for - just simply a way to make a timer. Well you’re on the right track with Time.time; here’s the code you need:

// at start of game/round
float startTime = Time.time;

// when player finishes game/round
float totalTime = Time.time - startTime;

As for saving to a text file, there’s a nice explanation here.

Im looking into time.time at the moment. I dont really need a visual timer. I need it to start when the game starts and stop it and save it to a file when the player finds the object. And then be able to do it again on a different scene with a different sound.