12. Change the clip, view or model
Play a particular embedded clip with the shared action. This example is a complete small GDScript record:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
await PlayGUIModelAnimation({
"guiId": "animation_lab",
"elementId": "avatar_viewer",
"animation": "PCA_OpenHands",
"loop": true,
"speed": 1.0
})
return trueTo stop the viewer animation, use Change GUI Element Property with property modelAnimated and value false. To change an authored view, use a property such as modelInitialView with the value left.
await ChangeGUIElementProperty({
"guiId": "model_lab",
"elementId": "object_viewer",
"property": "assetId",
"value": "owl_model"
})The second example belongs inside a run function. It swaps the loaded model asset while keeping the element ID. After swapping, check framing and clip selection: an animation name from the old model may not exist in the new one.
Changing view fields reapplies the starting view and can clear temporary player orbit/pan. Use those changes deliberately, not every frame while the player is inspecting the object.
