I'm making a game and I have a function that calculates the score and displays it on the screen. When the game ends it transitions into a new scene, (game over screen). I was wondering what method I can use to display my score on the second scene after it transitions. My code is:
var score = 0
var scoreLabel = SKLabelNode()
func updateScore() {
score++
scoreLabel.text = String(score)
}