11. Use model actions in a GUI event
1. Add a Button beside object_viewer and give it the caption Center model.
2. Open Events and set Click to Center GUI Model.
3. Choose GUI model_lab and 3D Model object_viewer.
4. Run the game, move the view and press the Button.
Figure 13. Center GUI Model targets the owning GUI and the 3D Model element.
| Shared action | Fields |
|---|---|
| Center GUI Model | GUI and 3D Model. |
| Play GUI Model Animation | GUI, 3D Model, Animation, Loop and Speed. |
| Change GUI Element Property | For authored viewer fields such as assetId, modelInitialView or modelAnimated. |
These actions are also available in action lists and visual scripting. Use a separate Button for a story action when dragging should remain a harmless inspection gesture. A model’s generic mouse Click event can otherwise fire at the start of an orbit drag.
