4.3.stable
I have a game element that’s supposed to have a different color depending on an enum. I have exported the enum so I can change it through the editor. Is there a way to make the color of the element automatically change when I change the enum?
If you want to change it ‘live’ in the editor you should look into @tool scripts and property setters: Running code in the editor — Godot Engine (stable) documentation in English.
@tool
If you just want to set it when the game is running, you can simply use the value of the variable to set the color when you need it (e.g., in _ready).
_ready
The former is what I’m looking for. I’ll look into it, thanks.