> 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

### 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
