I have some code that changes the color of the player when I press a button:
var color = SpatialMaterial.new()
func _on_Blue_pressed():
color.albedo_color = Color(0, 0, 1)
$MeshInstance.set_surface_material(0, color)
But when I change the scene it resets the color.
I know the basics of how singletons work but I have no idea how to keep the color the same using them. I assume I would need to change the player's color in the singleton's script but I cannot figure out how to do that, does anyone know how I can do this?