How to make Singletons/Autoloads reload upon get_tree().reload_current_scene()

Godot Version

Godot Engine v4.2.2.stable.official.15073afe3


I want to restart my game when pressing a button, and this is how I’m currently doing it:

func _on_restart_button_pressed():

The problem is that I want to refrest some variables that I have in an autoload but they aren’t refreshing when reloading the current scene

Call a method when you change the scene, you control it yourself