# 🎉 Animations

A crate plays two kinds of animation, both set from its Animations menu: an idle animation while nobody is opening it, and an opening animation when a player does.

<figure><img src="../../.gitbook/assets/editor/crates/animations.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate</p></figcaption></figure>

## Opening Animation

Plays when a player opens the crate, through its three phases, up to the reward being revealed. Every phase and animation is on [Opening Animations](opening-animations/README.md); the animation add-ons add more on [Animations](../../add-ons/animations/README.md).

<figure><img src="../../.gitbook/assets/editor/engine/opening-animation.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate > Animations</p></figcaption></figure>

## Idle Animations

Plays while nobody is opening the crate, and is built from particle effects. There are 120+ effect combinations available.

<figure><img src="../../.gitbook/assets/editor/engine/idle-animation.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate > Animations</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/editor/idle-animation/add-effect.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate > Animations > Idle Animation</p></figcaption></figure>

### Effect Type

In the drop down below, you’ll find all the available effect types we currently offer.

<details>

<summary>Effect Types</summary>

| Effect         | Shape                            | Plan    |
| -------------- | -------------------------------- | ------- |
| Default        | Simple particle spawn at offset  | Lite    |
| Circle         | Particles orbit in a flat circle | Lite    |
| Star           | Five-pointed star pattern        | Lite    |
| Square         | Square frame around the crate    | Lite    |
| Deltoid        | Triangular curved shape          | Premium |
| Astroid        | Four-cusped hypocycloid          | Premium |
| Flower         | Petal-like flower pattern        | Premium |
| Quatrefoil     | Four-lobed clover shape          | Premium |
| Diamond        | Diamond-shaped outline           | Premium |
| Ninja Star     | Spinning shuriken pattern        | Premium |
| Spiral         | Ascending helix spiral           | Premium |
| Conical Spiral | Cone-shaped rising spiral        | Premium |
| Pulse          | Expanding ring pulse             | Premium |

</details>

<figure><img src="../../.gitbook/assets/editor/select-effect-shape/diamond.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate > Animations > Idle Animation > Select Effect Shape</p></figcaption></figure>

### Particle Type

There are 100 different particle options available for you to choose from for your crate.

* **None** - This type of particle can't have any special behavior.
* **Directional - This type of particles can have a velocity.**
* **Colorable - This type of particles can have a color.**

### **Additional Options**

* **Color -** Not all particles support color. Redstone is a well-known particle that can change color, but others may not. If a particle doesn’t support color, this field will be ignore**d.** Clicking it opens the color picker: pick one of the preset colors, or use Custom RGB to type any color as R,G,B. Opening animation color settings use the same picker.&#x20;
* **Offset -** Defines the position of the effect relative to the crate.
* **Radius -** Controls the randomness of the effect’s position.
* **Amount -** Sets the number of particles to display. For example, with a circle pattern and an amount of 2, you’ll see a 2-particle effect. (Recommended to test in-game.)
* **Velocity** - There are some particles that allow speed. This field allows you to change the speed of each spawned particle.

### Edit an Effect

Once an effect is created, it will appear in the main effects list, where you can Left-Click to edit it. The maximum number of effects you can add is 12.

<figure><img src="../../.gitbook/assets/editor/idle-animation/star-3.png" alt="" width="375"><figcaption><p>Editor > Crates > Crate > Animations > Idle Animation</p></figcaption></figure>

### In the Config File

Each effect is stored on a single line in the crate file, under `idle-effects`:

```yaml
idle-effects:
- CIRCLE;{REDSTONE;#ff0000;0.0;1.0;2.0;0.0;0.0;1}
```

The format is:

```
TYPE;{PARTICLE;COLOR;offsetX;offsetY;offsetZ;spread;velocity;amount}
```

| Field    | Description                                                        |
| -------- | ------------------------------------------------------------------ |
| TYPE     | The effect type, such as `CIRCLE` or `SPIRAL`.                     |
| PARTICLE | The particle to use, such as `REDSTONE`.                           |
| COLOR    | The particle colour as hex, ignored by particles that cannot be coloured. |
| offsetX  | Position relative to the crate, sideways.                          |
| offsetY  | Position relative to the crate, height.                            |
| offsetZ  | Position relative to the crate, depth.                             |
| spread   | Randomness applied to each particle's position.                    |
| velocity | Speed given to each particle, on particles that support it.        |
| amount   | How many particles to spawn.                                       |

Editing from the editor is easier and safer, but knowing the format helps if you generate crates outside the game.

Example of the Idle Animation In-Game

<figure><img src="../../.gitbook/assets/Untitledvideo-MadewithClipchamp91-ezgif.com-video-to-gif-converter (1).gif" alt="" width="563"><figcaption><p>Example of the Default Idle Animation</p></figcaption></figure>

Source: https://www.phoenixplugins.com/docs/phoenix-crates/main-features/animations