# UE5 Turn in Place Animation in UNDER 5 Minutes

**Channel:** LearnCodingWithADummy
**Source:** https://www.youtube.com/watch?v=AXT0IXZVdMQ
**Transcript page:** https://www.withtranscript.ai/video/AXT0IXZVdMQ

## Chapters

- 0:00 — Setting Up the Turning System
- 0:26 — Preparing Turn Animations and Montages
- 1:29 — Creating Turn and Disable Functions
- 2:18 — Turn In Place Logic and Final Assembly

## Transcript

**[0:00]:** Hey, in this tutorial I'm going to teach you how to make this really cool turn and play system. Let's get right into it. All right, let's make a new variable called turning. Then let's do a custom event. Press me. Call it play turn and branch. Boom. Boom. So, what if we're already turning? Do nothing. Now, if we're not turning previously, start turning. Then, let's play a montage.

**[0:26]:** First thing you're going to have to do need to do is get yourself some turning animations. Preferably 90°. Let's get So now we just assign that to our mannequin. Hulk edit.

**[0:41]:** Turn on root motion and force the lock. Save. So now inside of our play montage, we'll force our mesh here. Then we'll plug this in to a montage to play. Let's set this up at 1.5 cuz it's too slow. Then we will delay this by about half a second. The delay is for when it's safe. If you have a animation that needs like two turn in places, how long should it wait before it can safely cut to the next one? Speaking of montages, let's create those. Done. So, preferably I'd make a notify, but whatever. So now that we're not let's not turn anymore so that if we still have to we can just re we can play the animation again.

**[1:29]:** So now we simply have to create now let's do a function called turn do a branch then call this is turning right then if we are turning right play the turn animation. Wow this is easy turn right if not must be left turn left. Congratulations. That's it for the function. Create another function. Call this disable current root anom. So this will just remove any montage that's doing root motion. Do a branch a is playing anom root motion. Then if so get montage, then just stop it immediately. Congratulations. That's it for this function.

**[2:18]:** So now here comes the fun part. Turn in place. This is where it all happens. All right, let's get right into it. First, we need yet another if statement. But what do we slap into our if statement? A is falling to make sure that we're not doing anything. Get velocity. Make sure we're genuinely staying still. Left it so that this is just for like safety measures. Then not on both of them. Not then what? Oh, greater than zero. So then and so that if we're falling and we're standing still, we're good to go. If so, let's go on to another branch. Get actor rotation base aim rotation delta them both. Break this multiply by -1. This negates it. So now we will just do a greater than 45° trust me. Then a less than 45° then negative 45. So now we need an or. So this is like the trigger on what to play our animation on.

**[3:36]:** Then we are in the range or out of range to play the turn animation. But get these back. Simply copy them. Plop one here. Plop one here. Boop. Put them all in your negated delta that I previously mentioned. A turn. With this one, we are going above 90° 45. And with this, we are turning left. So now go into your Let's just pop this into place into our aim. And let's see. You're done.
