Setter and getter functions in Godot 3 with setget

Published: 04 January 2022
on channel: The Shaggy Dev
5,825
221

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: https://shaggydev.com/2022/01/04/setget

Official documentation: https://docs.godotengine.org/en/stabl...