How can I export a variable that is using a setter and getter?

I have an exported variable that uses the setget syntax:

@export var arena_size : int = 80 : set = setArenaSize

func setArenaSize(size: int):
	arena_size = size
        # Updating all sorts of properties (StaticBody3D position, MeshInstance3D  size...)
	print("Something for debuging purposes")

When I change the value in the editor, nothing changes! May it be in the 3D view or the output console, nothing happens. The only thing I see is Set arena_size in the output. Is there actually a way to call the setter function when changing the variable through the editor?

You need to mark the script as a @tool script. More info here Running code in the editor — Godot Engine (stable) documentation in English

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.