0

I'm making a game where I switch scenes every so often. I need variables to safe between these scenes so I made a global singleton named: "global.gd". This is the code:

extends Node

var money = 1
var lives = 3

The problem is that every time I switch scenes the amount is reseted to 1 and 3. So even if I change the amount during a round, when I switch to another scene it just goes back.

What am I doing wrong?

1 Answers1

0

Well... I think my project was just glitched, tried another project and it worked like a charm there... Sorry for bothering you!