Hi everyone, I'm currently new to Godot, having come from using Unity in the past and have just started getting into UI. I have a scene with my UI and another scene for my main game. I want to change a variable in my main game script using a button press from my UI scene using a button. For reference, I'm making a building game using tilemap's and I want to use buttons to select the tile I want to place; I currently have it so I can scroll with my mouse and place/break with my mouse buttons. If anybody can just give me a bit of advice/help to get the ball rolling, thank you! :)
#Using a button in one scene to change a variable of a script in another scene
2 messages · Page 1 of 1 (latest)
Hello, for this, I think you want to look into the autoload feature of Godot, which allows for global variables.
https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html
Godot Engine documentation
Introduction: Godot's scene system, while powerful and flexible, has a drawback: there is no method for storing information (e.g. a player's score or inventory) that is needed by more than one scen...