53. Call a graph from a GUI button
Figure 34. The button’s Click event calls the selected graph. This screenshot uses the run-visual-script behavior.
1. Open GUI Designer and select the Pulse Beacon button.
2. Open Events. Find the Click event.
3. Choose run-visual-script and select gui_button as its target. The shared Run Visual Script action is another available route.
4. In gui_button, connect an On Interact: use entry to Run Visual Script: pulse_three.
5. Apply/save the GUI and graph, then start Play.
6. Click the runtime button. The beacon should pulse three times.
The event supplies guiId, guiElementId and the GUI event name. The captured owner is the GUI. If a node needs the current element, the special elementId value this can use guiElementId; an object target still needs a real scene object ID.
The visual-only GUI Designer preview is for appearance and control states. Test gameplay event execution in Play. A hover image working in the designer is not proof that a script was called.
Keep click, press/release and hover responsibilities separate. Repeated hover events should not award inventory or start the same long sequence over and over.
