14. Read the current carousel entry
The current carousel entry is not automatically written to a Selected Item Variable. This build does not expose a typed output field like the List Box does. A separate confirmation Button can read it through the public GUI-property helpers.
Create a String variable gallery_feedback and a Label with Text $$gallery_feedback. Then create this GDScript record:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
var entries: Array = GetGUIElementProperty(
"gallery_lab", "reference_carousel", "entries", []
)
var index: int = int(GetGUIElementProperty(
"gallery_lab", "reference_carousel", "selected_index", 0
))
var result: String = "The gallery is empty."
if index >= 0 and index < entries.size():
var entry: Dictionary = entries[index]
result = str(entry.get("caption", ""))
result += " | ID: " + str(entry.get("id", ""))
await SetVariable({
"name": "gallery_feedback", "value": result
})
return true1. Apply Changes to the script.
2. Add a Read current entry Button. Set Click to run-visual-script and Click Target to the script ID.
3. Run the game, browse to Map Room and press the Button. Check the returned caption and ID.
entries and selected_index are widget properties checked in 0.86.3.4. This is an advanced property-reading workflow, rather than a dedicated carousel selection event.
