Hello, I am trying to use custom signals to pass variable speed from one scene into a singleton and then have player scene use this singleton for the speed.
Currently I have in CharacterSheet.gd:
signal speed_signal(speed)
funcready():
connect("speedsignal", getnode("/root/DataImport"), "PlayerStats")
func process(delta):
emitsignal("speed_signal", speed)
DataImport.gd (singleton)
var speed = 300
func Player_Stats(speed):
print(speed)
So the thing I am trying to figure out is print(speed) returns the correct speed values from the CharacterSheet.gd, but var speed stays at 300 when it gets grabbed by the Player scene. And if I dont assign a default value for the var speed it just grabs nil/0/error and not the value I have under func Played_Stats(speed)
Any help appreciated.