# Animationer\*

* Animator: hanterar vilken animation som ska spelas
* Animator controller: state machine som styr en animator
* Animation clip: en specifik animation

## Skapa animationer

* Window->Animation->Animation
* Skapa clip & addera Animator-komponent
* Animera properties med keyframes

## Kod

### Animator

#### Play()

Spela upp en specifik namngiven animation.

```
GetComponent<Animator>().Play("WalkLeft");
```

#### SetTrigger(), SetBool(), SetFloat(), SetInteger()

#### runtimeAnimatorController

GetCurrentAnimatorClipInfo()

* Get en array

### AnimationClip

* name
* length

### RuntimeAnimatorController

* Klass som beskriver en AnimatorController
* animationClips: read-only array.
  * Kan göras till List och sedan Find:as för att hitta specifikt clip


---

# Agent Instructions: 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:

```
GET https://unity.progdocs.se/grundfunktioner/animationer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
