> For the complete documentation index, see [llms.txt](https://docs.viverse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-unity-sdk/animated-glb-models.md).

# Animated GLB Models

Play animations from streamed GLB/XRG models using the SDK's hybrid animation system.

### How It Works

The SDK bridges a **Legacy Animation** component (drives the mesh) with an **Animator** component (runs your state machine). This is necessary because clips are loaded dynamically at runtime and cannot be embedded in an Animator Controller asset at edit time.

Morph target (blend shape) animations play automatically as part of clip playback — no extra setup needed.

***

### Inspector Setup

1. Enable **Log Animations** on ***`StreamingModel`*** to see available clip names at runtime.
2. Create an **Animator Controller** asset with states. Assign a **dummy AnimationClip** to each state, named to match the model's clip name (e.g. `"Idle"`, `"Walk"`).
3. Assign the controller to **Custom Animator Controller** on ***`StreamingModel`***.
4. Press Play.

> **Clip matching**: The SDK matches by exact name first, then by numeric index (e.g. `"0"`, `"1"`).

***

### Animation Modes

| Mode            | Behavior                                                                                                     |
| --------------- | ------------------------------------------------------------------------------------------------------------ |
| `Auto`          | Default. Uses ***`EmbeddedClips`*** without a controller; ***`VrmMecanim`*** if controller + humanoid bones. |
| `EmbeddedClips` | Standard path for animated GLBs.                                                                             |
| `VrmMecanim`    | Mecanim humanoid retargeting. Requires humanoid skeleton.                                                    |
| `None`          | No animation.                                                                                                |

***

### Quick Code Reference

```csharp
// Wait for load, then control animations
streamingModel.SetLoadedCallback(() =>
{
    streamingModel.PlayAnimation("Idle");
    streamingModel.SetAnimationFloat("Speed", 1.0f);
    streamingModel.SetAnimationTrigger("Jump");
});

// Swap controller at runtime
streamingModel.RuntimeAnimatorController = newController;
```

***

> For the full API reference (StreamingModelAnimator tuning, complete examples, troubleshooting), see `USAGE_ANIMATED_GLB.md` shipped with the SDK package.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.viverse.com/polygon-streaming/integrations-and-plugins/polygon-streaming-unity-sdk/animated-glb-models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
