The docs arent explaining very well what this self keyword is, i just want to know what it does. I searched everything and theres nothing saying about it.
It’s explained in the GDScript basics doc:
self - Refers to current class instance.
self
It serves essentially the same purpose as self or this in other object-oriented languages.
this
Specifically in GDScript, when used in a script, it’s a reference to the object the script is attached to.
It’s used whenever you need a reference to the current node, for example when connecting a signal to a local function:
func _ready(): connect("some_signal", self, "some_function") func some_function(): # signal is now connected here