Setter and getter functions in Godot 3 with setget @TheShaggyDev
Setter and getter functions in Godot 3 with setget  @TheShaggyDev
Uploaded January 2022 | Updated November 2026, 2 hours ago
Setter and getter functions allow you to write custom logic to be ran when a variable to written to or read from. In Godot, we can define setter and getter functions using the setget keyword, followed by the names of the setter and getter functions, respectively. This video demonstrates the technique along with providing some useful tips for when you're using setget in a project.

Text version of this video: shaggydev.com/2022/01/04/setget

Official documentation: docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html#setters-getters
Setter and getter functions in Godot 3 with setgetHow unit selection works in my tactical strategy gameCreating volume sliders in Godot 4Advanced state machine techniques in Godot 410 small ways to make your life easier in GDScriptFree Loopable Game MusicManaging unit data in my turn-based strategy gameThe easiest way to monitor anything in Godot 411 tips for writing cleaner codeGodot 4 beta + channel updateCallbacks and function references in Godot 3 using FuncRefsCome join the Discord!
The Shaggy Dev |

Setter and getter functions in Godot 3 with setget

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER