Exported value: Live updates when values are changed in the Inspector?

Hi,

I want to change an exported value in the Inspector while setting up a scene and I want to see the effect immediately, rather than when I start/test/running the scene.

How can I get the changed value from the Inspector back into my script?

Example:

@export var isVisible = false


# always when value changes in the Inspector:
sprite.visible = isVisible 

Jeff

Make it a tool script and implement a setter function for the property.

2 Likes

Thanks for the tip. It worked.

Example:

@tool 
extends StaticBody2D

@export var style = 1:
	set(new_style):
		style = new_style		
		setStlye(style)
1 Like