Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

setget godot

var my_var setget my_var_set, my_var_get

func my_var_set(new_value):
    my_var = new_value

func my_var_get():
    return my_var # Getter must return a value.

#Only a setter
var my_var = 5 setget myvar_set

#Only a getter
var my_var = 5 setget ,myvar_get
Source by godotengine.org #
 
PREVIOUS NEXT
Tagged: #setget #godot
ADD COMMENT
Topic
Name
1+6 =