# Idle Animation

## What is an idle animation?

* Idle animations are animation loops that occur when the character is not performing any actions.

### You can make this with an idle animation

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2Fco2uBrjp4rAEgw54to50%2FIdle%20Animation.gif?alt=media&#x26;token=e98ae724-f283-4e36-ae31-3f6aa866df26" alt=""><figcaption><p>Example of Breathing Idle Animation</p></figcaption></figure>

* Common idle animations include but not limited to:
  * Looking around.
  * Sleeping/stretching/relaxing.
  * Reading a book/playing a video game.
  * Playing/fidgeting with objects.
  * Commenting on the ambiance.
  * Adjusting clothes/weapons.
  * Singing and/or dancing.
  * Flicking long hair if any
  * Entertaining themselves
  * Interacting with each other, if any
  * Getting impatient

## How to create idle animation in MYTY Kit

* MYTY Kit provides **Frame Sequence 1D Adapter** to support the sequential animation of sprites. As the name suggests, it is an adapter that takes a sprite 1D Controller as a target. With some configurations, this adapter outputs a single float value which varies on time and is used as an input for the target Controller.

### Frame Sequence 1D Adapter

* Image of the inspector window of the adapter

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2FLaunm3dmJIk9iJQKsJbJ%2Filde_framesequence.png?alt=media&#x26;token=4c0f751b-73dc-454b-8789-c40b1d2fee1f" alt=""><figcaption></figcaption></figure>

1. `Controller`: The target controller to apply loop animation
2. `Start`: Start value of interval. It can be larger than the End value.
3. `End`: End value of interval. It can be smaller than the Start value.
4. `Repeat`: If this field is checked, the animation will loop forever.
5. `Swing`: (Valid only if Repeat is checked) Specify how the output value repeats.  Suppose that Start and End are 0 and 1.
   * If unchecked, the value moves from 0 to 1. After it hits the End value, the value goes to Start and continues to move to End. 0…1→0…1
   * If checked, when the value hits the End, then the value moves back to the Start. 0…1→1…0
6. `Step Count`: Specify how many steps are included n the interval
7. `Unit Time`: Determines a time interval for each step in seconds. `Step Count * Unit Time` will be the duration of a single cycle of an animation.

### How to Use the Frame Sequence 1D Adapter

1. Configure a sequence folder for idle animation in the animation folder of the PSB file

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2Fsp5E2cCeKgL35IyUhVx9%2Fidle_1.png?alt=media&#x26;token=f1698645-6f78-4c39-85f2-cdecde2dcf0d" alt=""><figcaption><p>Name of the group folder (VfxA, VfxB, ... VfxD) needs to be as same as in the placeholder layer under the VFX group layer.</p></figcaption></figure>

2. In 'Sprite Editor", assign a bone to VFX placeholder layer and sprites under Animation Group

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2FNm0kADWb9Niw1S1G4CQ7%2Fidle_2.png?alt=media&#x26;token=6c352829-c572-4dc0-9322-ce5f337af218" alt=""><figcaption><p>Sprites and placeholder layer MUST share the same bone</p></figcaption></figure>

3. Create an empty game object under 'Controller Group' and rename it according to your preference
4. Add component 'Sprite 1D Range Controller MSR' to game objects created in step 3

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2F0sohiP7tCzcX2yf0qkdW%2Fidle_3.png?alt=media&#x26;token=d2509a54-854c-4c03-9a76-9702c445dba3" alt=""><figcaption><p>Selected controller in the image contains 'Sprite 1D Range Controller MSR'</p></figcaption></figure>

5. Open ‘Sprite 1D Range Controller’ and add place holder layer in ‘Hierarchy’ and hit ‘Auto Load Labels’

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2FQrDP1jgH4Al0PKp0HRim%2Fidle_4.png?alt=media&#x26;token=9df70b0a-95cb-49a6-b984-c78195af8ee9" alt=""><figcaption><p>Animation plays can be edited by removing and re-ordering the labels under 'intervals'</p></figcaption></figure>

6. Create an empty game object under 'Motion Adapter Group' or a group with component: 'Motion Adapter Group' and rename it according to your preference
7. Add component ‘Frame Sequence 1D Adapter’ in the game object created in step 6

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2Fb5NPZH0BxIQuFK9DiJep%2Fidle_6.png?alt=media&#x26;token=7b745135-9204-4400-834a-6abe43f8c258" alt=""><figcaption><p>Additional components may be added as necessary to accommodate the requirements</p></figcaption></figure>

8. Modify the settings within the 'Inspector' window to achieve the desired animation effect
9. Press the Play button to check the applied idle animation

<figure><img src="https://1381431913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6CBs7vCLqptAiFUTrCYl%2Fuploads%2F5i8tt3H3WilOndI6LQHT%2Fidle_7.gif?alt=media&#x26;token=0c375a89-09fd-4d4b-b977-4cc7ca50458e" alt=""><figcaption></figcaption></figure>
