> For the complete documentation index, see [llms.txt](https://polyart.gitbook.io/pixel-2d/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyart.gitbook.io/pixel-2d/guides/animations-and-state-machines.md).

# Animations & State Machines

{% hint style="info" %}
**Good to know:** Both the Platformer Engine & Top-Down Engine share a lot of functionality. and a lot of times the same techniques can be applied to both engines.
{% endhint %}

## Setup

Any item that needs to be animated needs a flipbook made out of the individual sprites of each state the character has.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FOwplVW2MsvpzTcxqh91S%2F13._Create_two_flipbooks.png?alt=media&amp;token=5d6ac8e3-c21f-44fe-ab6c-51bebcd63b09" alt=""><figcaption></figcaption></figure>

To do that, first import the sprites of your choice. you can also import a sprite sheet. However then you will have a few extra steps.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FjOnhAbG4sgxtZ8yJ1OFS%2F0.ImportCharacter.png?alt=media&amp;token=658c334b-d564-4301-a97e-f5528bcb32a3" alt=""><figcaption></figcaption></figure>

**Apply Paper2Dtexture** to what you have imported by **Right-Click → Sprite Actions**. If you have imported a sprite sheet, you will also have to **Extract Sprites** through **Sprite Actions.**

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FnemIEQzO9CmyZAEvWc5y%2F0b.ExtractSprites.png?alt=media&amp;token=8c9b3ca3-cde8-4d4e-bef4-80cafa2ef13c" alt=""><figcaption><p>Unreal should be able to recognize your sprites and extract them automatically but if that’s not the case, switch Auto mode to Grid mode for better control over your sprite sheets.</p></figcaption></figure>

Select the sprites that make up one animation and turn them into a single flipbook. Do this with each state for your player/animated object.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2Fd1VwgaGJu8xOI1tdphb6%2F0c.Right_click_to_create_flipbook.png?alt=media&amp;token=5376433b-1296-48e0-bdb7-5683f70d8554" alt=""><figcaption><p>You do NOT have to make sep<strong>a</strong>rate animations facing right and left. We will learn how to flip the animations through code later on.</p></figcaption></figure>

Next, click on a flipbook to make any changes to animation speed or even the animation itself. You can add and delete frames here without making another animation.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2Fgh5R2pYlOt5WrmM0qNrN%2F0d.Adjust_speed_for_moving_sprites.png?alt=media&amp;token=2fc02d63-289f-4d37-93d5-9a19b3c15524" alt=""><figcaption></figcaption></figure>

## Inside the Sprite Animation

If you are familiar with Unreal and it’s animation tools, you will find the **Sprite Animation** easy to navigate, however knowing animation blueprints before isn't a necessity. Here are elements you will find in the animation blueprints.

### State Machines

When you open the animation blueprint, you will most likely start in the **Anim Graph.** Here you can add a state machine with **Right-Click → New Sprite State Machine**. The Sprite State Machine is a container that holds your States, Conduits, Transitions, and Animations. You can also add state machines inside states to help you organise your animations. You can get more information over here: <https://docs.unrealengine.com/5.0/en-US/state-machines-in-unreal-engine/#conduits>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FzMsNiFA99ao4VzdR3boA%2F15.NewStateMachine4.png?alt=media&amp;token=2773311d-943e-480e-8a51-e5bd6aa840b8" alt=""><figcaption></figcaption></figure>

### States

Inside a **State Machine** you will see the Option to add **States** and **Conduits**. We will discuss about **Conduits** with transitions due to their complementary functions.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F0V4qtPwJa88ek0VzUWOq%2F16.Add_state_inside_State_machine.png?alt=media&amp;token=63497d85-73eb-4787-beb6-fa9d19a42f12" alt=""><figcaption></figcaption></figure>

**States** are objects that hold animations or nest other **State machines**. Every action your character does (walking, picking up, attacking) is a **State**.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F1uOHuNW52U75yxWFDnsJ%2F17.Basic_State_Machine.png?alt=media&amp;token=cbe391fc-8d7c-4c75-89dc-6a10cb94a568" alt=""><figcaption></figcaption></figure>

In top-down view, you will have 3 states for each action: Action facing up, Action facing down, and Action facing side (we will flip the sprite left and right using blueprints). Inside each of them we are going to add a state machine with all of the actions we expect the player to take.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2Fcg3in5kb9fOkVopWuruj%2F5a.Nested_State.png?alt=media&amp;token=981d34f3-c325-4e8a-baa1-fd182048ddd9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FEX2dwHqnGd13c6v8AqgR%2FUntitled.png?alt=media&amp;token=9f43c60e-fbc4-4cd7-aaae-84d2118f2278" alt=""><figcaption></figcaption></figure>

You don’t have to do it exactly like this, you are free to experiment and find a method that works for you.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F9QK6zOGCSx6U6dwm39K5%2F4.Conduit.png?alt=media&amp;token=325a270d-122a-483a-ad40-78cdcebc5367" alt=""><figcaption></figcaption></figure>

Inside each of these states is a respective flipbook connected to the result node.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F42ERvNtxwCrO9nq5j3e0%2FUntitled%201.png?alt=media&amp;token=3c46d3a7-ae94-4a2e-8964-80d0ed77bb91" alt=""><figcaption></figcaption></figure>

But how does Unreal know which **State** should be played when? That’s where **Transitions and Conduits** come in.

### Transitions and Conduits

*Jormongandr has provided a great answer in this forum if you would like to understand the difference between Conduits and Transitions better*

[AnimBP: What is a Conduit and why do you need it?](https://forums.unrealengine.com/t/animbp-what-is-a-conduit-and-why-do-you-need-it/363568/4)

#### Transitions

Transitions are rules that define when one State or Conduit changes from another.

Not all states need to be connected to each other, but each state needs at least two transitions: One to enter into the state and one to exit out of the state.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F0iCHh9sUNoEquO03TNZC%2F3._Transition.png?alt=media&amp;token=1900a038-9e8a-47aa-8750-38e90a5c3e10" alt=""><figcaption><p>You can hover over transitions to check if they are empty or correctly coded</p></figcaption></figure>

{% hint style="info" %}
If you see an error with the **Can Enter Transition** Node as shown below, its because the transition will not occur without a rule attached. If you don’t have a rule for this transition, just check the box to set it to **true**.
{% endhint %}

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FlgXGUmIH2ViJuMJC14xi%2FUntitled%202.png?alt=media&amp;token=c64d9381-97ad-410c-b248-1a85818f0e81" alt=""><figcaption></figcaption></figure>

Let's create a transition as an example. Say you want the Animation to change everytime the player attacks.

First we need to know when the player is attacking. Inside the Player Blueprint let's create a **Boolean** called *IsAttacking?* that is set to true everytime the player attacks, and is set to false when the attack ends.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FMzxX0sRbwqv965GMYkwR%2F7._PlayerAttacking_Bool.png?alt=media&amp;token=2762392c-6a67-43b5-b01d-c949ab97ce5c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FarodDjWfRYu6FW7Eg2HT%2FUntitled%203.png?alt=media&amp;token=a97d4fe0-e435-4e53-b774-17d34d2929d3" alt=""><figcaption></figcaption></figure>

Now we need to make sure our blueprint can call this variable (a.k.a it can use it to transition in and out of our attack state).

For this, we need to use our **Event Graph inside the Animation Blueprint.** Here, we are casting to player character to store the attack bool and other variables as a local variables I can use for transitions.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FMMsHWl2NHiL1DlNd5yAg%2FUntitled%204.png?alt=media&amp;token=4d5b0ce6-1414-40fa-91e7-afaef0929240" alt=""><figcaption></figcaption></figure>

Double-click on the Walk to Attack and Idle to Attack to create this simple transition for attacking.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F4jgLUrAbl17heO53PHuU%2F21.Walking_to_Attack.png?alt=media&amp;token=4a759c0e-77d0-4651-95a5-d0afcc3c952a" alt=""><figcaption></figcaption></figure>

You would be tempted to make the Attack to Walk and Attack to Idle transition like this.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FPlI27zCtLbuMJLmo8ljz%2F22.Player_stops_attacking.png?alt=media&amp;token=303ad20b-16ef-4982-84e9-b13c5ec413b5" alt=""><figcaption></figcaption></figure>

However, when you do you notice the animation stops in its tracks. That's because as soon as the Boolean is set to false, the blueprint transitions out of the respective state. You can either fine-tune the code using precise delays or, you can use **Get Relevant Anim …** Nodes and use **Less than** nodes to transition as soon as the animation ends. I have used both types of nodes for the transitions as I will show later.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FxGFb3uA9ZRg6tTBwjtDe%2F3a._Transition_if_your_animation_is_too_short.png?alt=media&amp;token=b02583a4-3011-4c49-8a97-fad7ff585b40" alt=""><figcaption></figcaption></figure>

### Conduits

**Conduits** are animation-less States. If you double-click them, you will see that they look more like transitions then states because you can add rules to them as well, but usually setting *Can Enter Transition* to true is enough.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FRJhSF5gNW3oeOgMVqgIY%2F4a._Inside_a_conduit.png?alt=media&amp;token=700119b0-9513-41dd-97c4-3835c299f588" alt=""><figcaption></figcaption></figure>

They are used to create branches and streamline animation blueprints. Without Conduits we had to connect Walk and Idle to each type of attack. Though that looks manageable when you only have three attacks, as you need it will become an absolute mess the more attacks you have.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FvFh0PljkAG37agDEGXsY%2FUntitled%205.png?alt=media&amp;token=6a27eeb3-42d1-4680-9936-9ad7188b385d" alt=""><figcaption><p>Without Conduits</p></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F8crIJMHhA37Uh3Et1810%2FUntitled%206.png?alt=media&amp;token=a2e1dff0-b727-4198-9b1f-aaa9dd45cb7a" alt=""><figcaption><p>With Conduits</p></figcaption></figure>

You may have also noticed before that there are two variables defining my player’s attack. The *IsAttacking?* bool defines whether my player is attacking or not and the *AttackType?* Enum (specifically an **E\_AttackList Enum**) decides which type of attack it is going to be.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F083KOBR5RB8JMDULjAbv%2F7.Create_an_enum_variable.png?alt=media&amp;token=32991592-3b3c-4909-ab61-7477d2e03189" alt=""><figcaption></figcaption></figure>

Instead of creating 6 different transitions with variations of both variables, here’s how our **State Machine** for Melee Attack is arranged.

For **Idle/Walk State → Attack Conduit Transitions** we used a local bool connected to the player’s *IsAttacking? b*ool.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FNMC4YFQujsbtQ3V3e6S8%2F18._IdleorWalk2Attack.png?alt=media&amp;token=21889329-a144-4051-a382-16934193ec7f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FiaNVBCowuwMkUQdlksLZ%2F21.Walking_to_Attack.png?alt=media&amp;token=ebc32f39-a5a7-44d1-90f1-17513bd7a5b2" alt=""><figcaption></figcaption></figure>

For **Attack Conduit → Idle State**, we simply added a **Not** node to the local boolean, so the animation will switch to idle once the attack ends.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F1RFjMqFxoyQw3vtjXduH%2F18a.Attack2Idle.png?alt=media&amp;token=c731fca6-ae54-4e81-b6f3-cb34d7756b32" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FGWhyyIqKMC4rvWWNj25m%2F22.Player_stops_attacking.png?alt=media&amp;token=e5f15105-b35a-4934-8ed0-6f2edbfc83cb" alt=""><figcaption></figcaption></figure>

Inside the **IsAttacking? Conduit** we also set *Can Enable Transition?* to **true** so that the transitions can occur without an additional rule.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FtpRwFd7LjHlMH0UEG7mT%2F4a._Inside_a_conduit%201.png?alt=media&amp;token=03a18f13-aa45-4d5d-94c7-34e402a342d7" alt=""><figcaption></figcaption></figure>

From the **Attack Conduit → Melee/Grenade/Magic** we compare a local **E\_AttackList** enum (*Anim Attack Type?)* to *Melee Attack* with an **Equal to (==)** Node.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FwGkZJeb2UAtPv9wWbTwo%2FUntitled%208.png?alt=media&amp;token=c277ed65-2014-48e7-a19b-c828cc9e1169" alt=""><figcaption></figcaption></figure>

A.k.a The player will play the Melee animation if *Anim Attack Type* is set to *Melee Attack*.

From the **Melee State → Attack Conduit**, we use the **Get Relevant Anim Time Remaining Fraction** with a **Less than** Node to transition back once the animation finishes playing.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FuU6Xmpdw6Aj4rX33zVON%2F18b.Attack2Melee.png?alt=media&amp;token=c2654827-5857-4e6b-84e0-842bc08b6a1b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FAuKoF61dS3qKNxXl7M2x%2F3a._Transition_if_your_animation_is_too_short.png?alt=media&amp;token=ac9ce4dc-ddfa-49d5-b8c4-8d7e4a6b67e5" alt=""><figcaption></figcaption></figure>

And that completes our transition loop for Melee attack.

## Using Notifies

If you want to set up Events triggered by specific animation frames, you will use Notifies.

To use notifies, double-click on a state where you have a flipbook attached to the **Result** Node. Here I have opened **MeleeUp** flipbook, which automatically opens up in the **Notify edito**r. We can **double-click** on the frames to check which frame it is, and **Right-click** on them to **Add** or **Move a Notify** to that location.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FXFSE7lnCTroNwVOIdMWt%2F13.Adding_Notifies.png?alt=media&amp;token=3800d3c4-84b3-4e8c-a684-42833dab4d79" alt=""><figcaption></figcaption></figure>

To make sure you can call this event in the player’s Blueprint:

Create two custom events inside your player’s BP that would be triggered by the Notifies.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FyO0OSIiNTOeGMPSDcskw%2F14._Create_Custom_event.png?alt=media&amp;token=9b2c9f34-c9f4-42ad-b901-e1031cd6953f" alt=""><figcaption></figcaption></figure>

In your player’s animation blueprint’s event graph, you can call each notify, cast it to your player and use it to trigger your Custom Events.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FHUoKwPj7d0hAJCV1s1ZH%2F15._Call_the_respective_functions.png?alt=media&amp;token=15dc48e6-156b-4e88-8a42-b1f8902765c7" alt=""><figcaption></figcaption></figure>

Now you can use the notifies to trigger your code, like we are using it to spawn a test fireball.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FfMQ3JHC08iRWcop7f87N%2F16.Attach_the_event_to_custom_functions_(Rough_Version).png?alt=media&amp;token=4fe97efa-1fea-4564-acf0-89d1577352ac" alt=""><figcaption></figcaption></figure>

## Left/Right Animation Mirroring

You can be efficient and only use one set of flipbooks for both right/left orientations and just flip them 180.

First, you need to make changes to your movement code.

Start by attaching the *IsMoving?* bool (more information in the Core Game Mechanics page) to two different bools (because the state machine does not like it when the information is collected by a single bool). Then connect both bools to a branch.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FNGyWzJ5DBgmITTnYkorG%2F9.Add_the_local_variables.png?alt=media&amp;token=aa8e64f8-a665-4b44-97cb-20c63988b38d" alt=""><figcaption></figcaption></figure>

Create an Enum Variable out of E\_MovementDirection to store the direction your player will be facing.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FaszcKi6Amaj1sFXBX8ty%2F11.AttackType.png?alt=media&amp;token=019e4ca1-ea65-4658-9e02-3f2968869dc6" alt=""><figcaption></figcaption></figure>

You can set the direction any way you want. Here are two examples to start with. The important part is to make sure the **Set World Rotation** Values are the way it’s shown in the example.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FvOmrKPDm6DVjZYsHegRU%2F12a.CodetoFlipSpritesComplex.png?alt=media&amp;token=60129997-4f87-4611-a871-41d3c5bbc15f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2F1ChUVLkEk7Wvqzb5mXCb%2F12.CodetoFlipSpritesSimple.png?alt=media&amp;token=f8f4a806-094e-48f4-a697-e88524908d96" alt=""><figcaption></figcaption></figure>

Of the two, the upper one is a more polished code though both would work. Especially, by storing everything in variables and using the absolute function, the above code is more bug free and its much easier to change values through blueprints, compared to the code below.

In your animation blueprint, go to the transitions for **Up/Down → Side**. Make sure the Side state is called whether the direction enum is set to left or right.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FbrBUYHnbmrbKLNaj3qF6%2F5a.Nested_State.png?alt=media&amp;token=5a9ccd4d-84f8-4feb-855c-a80099843e42" alt=""><figcaption></figcaption></figure>

With this, your player should flip depending on which side they are on.

<figure><img src="https://184658417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwhC5kRxAV2gkiYRfd0As%2Fuploads%2FD92aaGt6kli0ob3rPKiz%2F8.DowntoSide.png?alt=media&amp;token=4d96d703-9e57-46a9-b195-204dc1234c24" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
&#x20;If your screen starts becoming blank instead, make sure to disable **Use Pawn Control Rotation** in the Camera and Spring Arm Player objects.
{% endhint %}
