19. Read or bind a Check Box
For a separate Apply Button, read the live button_pressed property. The authored checked property describes construction data; it is not a dependable read of the player’s current choice.
var subtitles: bool = bool(GetGUIElementProperty(
"settings_lab", "subtitles_check", "button_pressed", false
))
await SetVariable({
"name": "show_subtitles", "value": subtitles
})Put those lines inside a run function based on script_base.gd. If you prefer live variable updates whenever the box toggles, add a runtime binding instead.
1. Create a Boolean variable named show_subtitles with initial value true.
2. Select subtitles_check and open Raw JSON (Advanced). Keep the element’s existing properties.
3. Add the member below immediately after the opening brace, or edit the existing variable member.
4. Validate and Apply Element JSON, save, then test in gameplay.
"variable": "show_subtitles",Figure 30. The Check Box’s checked and variable members are distinct. Keep the variable default and starting check mark consistent.
Give Show hints its own Boolean variable, show_hints. Two independent check boxes should not share one output variable unless your logic deliberately combines them.
