# Turning radius for AI?

**URL:** <https://forums.unrealengine.com/t/turning-radius-for-ai/148241>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [July 28, 2020, 10:17pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241 "2020-07-28T22:17:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 28, 2020, 10:17pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/1 "2020-07-28T22:17:26Z")

</div>

I have some AI creatures in my game that walk around but when they start moving towards their next target, they just snap towards it instead of rotating around to face their target and then start walking towards it. Is there a way I could add a turning radius to my AI?

---

<div class="post-metadata">

**Author:** ![silik1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/silik1/32/482168_2.png) [@silik1](https://forums.unrealengine.com/u/silik1)\
**Post date:** [July 28, 2020, 10:46pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/2 "2020-07-28T22:46:01Z")

</div>

You can tweak the CharacterMovementComponent to your liking :

![Annotation 2020-07-29 004424.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/b/4b88440ec657520d09823e892111d07238719c05.png)

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 12:42am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/3 "2020-07-29T00:42:20Z")

</div>

> [@silik1](#):
>
> You can tweak the CharacterMovementComponent to your liking :
> 
> ![4b88440ec657520d09823e892111d07238719c05.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/b/4b88440ec657520d09823e892111d07238719c05.png)

That makes it start to move in a direction and the mesh rotation will be lagged behind the actual movement. I want an actual curve. [This is what your solution looks like](https://drive.google.com/file/d/1sldEVWrkIPsEvU4_USVueEXlKpI-8xQb/view), but I want something that looks like this:  
 ![Annotation 2020-07-28 185632.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/9/699dd1ce0d18edd138f0be44e9436b46bcf48d7d.png)  
https://forums.unrealengine.com/core/image/gif;base64  
​  
The black line is the path the AI will follow and the red dot is the AI, which is facing directly to the right but curves towards the path as it travels down it.

---

<div class="post-metadata">

**Author:** ![Kalazad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kalazad](https://forums.unrealengine.com/u/Kalazad)\
**Post date:** [July 29, 2020, 1:08am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/4 "2020-07-29T01:08:14Z")

</div>

You could use “Find look at rotation”, and plug the yaw into yaw of SetActorRotation. The “start” is your enemy, and “target” is the player.

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 1:16am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/5 "2020-07-29T01:16:15Z")

</div>

Wouldn’t that just do make it snap to face towards the player? I want it to follow a curve to turn around.

---

<div class="post-metadata">

**Author:** ![Kalazad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kalazad](https://forums.unrealengine.com/u/Kalazad)\
**Post date:** [July 29, 2020, 1:19am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/6 "2020-07-29T01:19:42Z")

</div>

I’m using it currently and the enemy rotates to face me.

```auto

https://imgur.com/a/l5DyNCg

```

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 1:22am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/7 "2020-07-29T01:22:12Z")

</div>

I’m looking for a way for the AI to follow curve to turn towards the player. Not get snapped to look in the direction of the player. Take a look at the image I posted above to see what I’m trying to do.

---

<div class="post-metadata">

**Author:** ![Kalazad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kalazad](https://forums.unrealengine.com/u/Kalazad)\
**Post date:** [July 29, 2020, 1:26am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/8 "2020-07-29T01:26:43Z")

</div>

Ah, sorry. I saw the image and din’t understand it, you want the enemy to still have velocity while turning, some kind of arc. I don’t have any way to help you with that… =/

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 1:27am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/9 "2020-07-29T01:27:54Z")

</div>

> [@Kalazad](#):
>
> Ah, sorry. I saw the image and din’t understand it, you want the enemy to still have velocity while turning, some kind of arc. I don’t have any way to help you with that… =/

Yeah thats exactly what I’m looking for.

---

<div class="post-metadata">

**Author:** ![Kalazad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kalazad](https://forums.unrealengine.com/u/Kalazad)\
**Post date:** [July 29, 2020, 1:32am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/10 "2020-07-29T01:32:07Z")

</div>

Maybe you could do something with RInterp To, I think Interp speed, is what sets the rotation?

The info window also says that it gives a “nice smooth feeling when rotating to target” So just add velocity and reduce the look at rotation?

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 1:38am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/11 "2020-07-29T01:38:46Z")

</div>

> [@Kalazad](#):
>
> Maybe you could do something with RInterp To, I think Interp speed, is what sets the rotation?
> 
> The info window also says that it gives a “nice smooth feeling when rotating to target” So just add velocity and reduce the look at rotation?

Yeah but that doesn’t solve the issue of calculating a circle to turn around on.

---

<div class="post-metadata">

**Author:** ![VenomStyx](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/venomstyx/32/490334_2.png) [@VenomStyx](https://forums.unrealengine.com/u/VenomStyx)\
**Post date:** [July 29, 2020, 5:39am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/12 "2020-07-29T05:39:04Z")

</div>

This sounds pretty complex.

Just talking here, because I could absolutely not do this, but sounds like you’ll need to have some sort of algorithm to determine a curve between 2 points. You’ll then need to generate points along that curve in 3d space.

Again, no idea how to actually do this though.

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [July 29, 2020, 1:02pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/13 "2020-07-29T13:02:55Z")

</div>

> [@VenomStyx](#):
>
> This sounds pretty complex.
> 
> Just talking here, because I could absolutely not do this, but sounds like you’ll need to have some sort of algorithm to determine a curve between 2 points. You’ll then need to generate points along that curve in 3d space.
> 
> Again, no idea how to actually do this though.

hm okay. I’ll have to do some research on an algorithm to do that.

---

<div class="post-metadata">

**Author:** ![SeanOMik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeanOMik](https://forums.unrealengine.com/u/SeanOMik)\
**Post date:** [August 11, 2020, 12:24am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/14 "2020-08-11T00:24:32Z")

</div>

Even if I find an algorithm for that, how could I implement it? I’m using black boards for my AI and I have no idea how I would create this.

---

<div class="post-metadata">

**Author:** ![blyxzen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blyxzen/32/1040549_2.png) [@blyxzen](https://forums.unrealengine.com/u/blyxzen)\
**Post date:** [May 7, 2023, 9:53pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/15 "2023-05-07T21:53:28Z")

</div>

Hate to necro, but I found a solution that works for my uses and given the lack of answers to questions just like this, figured I should share in case it could help anyone else. (NOTE: I’m using a Behavior Tree Task for my logic, however, it shouldn’t be that different in any other blueprint)

The problem is Unreal’s default response to AI Movement is “Turn in Place”, where the actor would rotate almost instantaneously to face its target (or it would rotate slowly while moving directly towards the target, which is almost worse). This works great for upright things, like humans, but not so much for things that are longer than taller, like most animals (this is because animals don’t really strafe like humans can, they mostly move forward or backward and rotate the front of their body to turn, much like a car). Instead, they need a “Turn Radius” system, a way where they can follow the path of a circle until they were pointing at the desired location. Unreal doesn’t have support for this out of the box, so the only solution is to create one, which is easier than it sounds. Basically you have to recreate functions like the “MoveTo” to use a “Turn Radius” system.

Step 1: Off of event tick, get the look at rotation from the pawn to the target location. Use only the Z-axis of the look at, otherwise it will rotate and move the pawn incorrectly. Then, interpolate the pawn’s current rotation with the look at rotation, and set the interpolated rotation as the pawn’s new rotation. This first step makes it so the pawn rotates in intervals each frame, instead of instantaneously. Also, you can use a Turn Rate variable as I have that connects to the “Interp Speed” of the RInterpTo node. This allows you to control how quickly each pawn can rotate in your game (if used in a Behavior Tree Task, I would suggest making it a “Blackboard Key Selector” type so it can easily be set by the pawn).

 ![Screenshot 2023-05-07 164717](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/f/4/0f4bdda1a44c22ecb5e8ad0530e11fbe0c576554.png)

Step 2: After the actor’s rotation is set, simply add movement input to the pawn on its Forward Vector. This moves the pawn forward slightly after every rotation and produces an arc. An added side-effect is that the turning radius automatically adapts to the pawn’s speed, making the arc larger the faster it moves, which is more realistic.

 ![Screenshot 2023-05-07 164732](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/a/71af5a2a13ec8e1d2db4140a5be3dd6e7ebcf52a.png)

Step 3: After moving the pawn, a check is performed to see if the pawn has reached a distance away from the target that is considered acceptable and, if so, finishes the process with success. Otherwise, everything repeats.

 ![Screenshot 2023-05-07 164738](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/1/f41b427a9477eae3e09f0e7ab63de99ea51a5a74.png)

In addition, I have a timeout on the Behavior Tree when this task is called, in case the turning radius causes the pawn to never reach its target.

This doesn’t allow you to determine an exact radius the creature should rotate around. For that, you would need a specific mathematical algorithm to place multiple target locations along a path, as far as I could tell. However, for my case (and hopefully others), this solution works just fine.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Kokuyouseki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kokuyouseki](https://forums.unrealengine.com/u/Kokuyouseki)\
**Post date:** [July 18, 2023, 5:22am UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/16 "2023-07-18T05:22:48Z")

</div>

I tried getting the usual navigation path, then use circle tangents and navrays to modify it into a path that counts for turning radius. Sort of worked though I stopped for different reasons (I was making my own movement component as I was trying to use box collision for a semi-physics pawn but doing proper replication takes too long so I gave up).

This way it doesn’t matter if the character movement can snap to direction, as long you do the navigation right and not allow it to move without one you are set.

Since this was first google showed me it is not necroposting, leave me alone! 🙂

EDIT: I read about A\* navigation that takes gradual turning into account but not sure where…

---

<div class="post-metadata">

**Author:** ![Madlions](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Madlions](https://forums.unrealengine.com/u/Madlions)\
**Post date:** [July 31, 2023, 7:38pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/17 "2023-07-31T19:38:15Z")

</div>

Hi it is called Hybrid A\*, and it is used for Car/vehicle pathfinding:

> **[Build software better, together](https://github.com/topics/hybrid-a-star)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 330 million projects.

So this can also be used somehow for animals tooo…

---

<div class="post-metadata">

**Author:** ![MartenZander](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/martenzander/32/589446_2.png) [@MartenZander](https://forums.unrealengine.com/u/MartenZander)\
**Post date:** [March 6, 2024, 5:26pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/18 "2024-03-06T17:26:58Z")

</div>

This is actually kind of genius! Thanks for sharing. What I did now is using an RInterpConstant. This way I get perfect circles with a constant rotation rate.

---

<div class="post-metadata">

**Author:** ![blyxzen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blyxzen/32/1040549_2.png) [@blyxzen](https://forums.unrealengine.com/u/blyxzen)\
**Post date:** [April 15, 2024, 10:37pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/19 "2024-04-15T22:37:34Z")

</div>

Reading back through this I realize (and it won’t let me edit my original post) I forgot to mention my proposed system **doesn’t support PathFinding**. It circumvents it and creatures will often run into various obstacles.

However, I don’t want to leave anyone high and dry with no solution, so what I’ve been using since is a sort of “MoveTo” actor to control the movement of the creatures. Here’s the rundown:

Create an actor class (I called mine simply `BP_MoveTarget`) and spawn one of these on BeginPlay in your AI Controller or pawn. Store a reference to it. Whenever you want your creature to move to a location, have it move to the MoveTarget actor instead, and manipulate the location of the MoveTarget. What I’ve found works best for creatures is:

1. On the first tick of the move, store the creature’s current rotation in a new variable (such as `CurrentRotation`).
2. Every frame get a look at rotation between the creature and target location and store this in another new variable (such as `TargetRotation`).
3. Interpolate `CurrentRotation` to `TargetRotation`.
4. Next, convert the `CurrentRotation` to a forward vector (`CurrentForwardVector`) and project the location a distance along that vector. I’ve found that 2,000 - 3,000 units is a decent distance, but configure to your needs (this math would essentially be `CreatureActorLocation + CurrentForwardVector * ProjectionDistance`).
5. Finally, set the MoveTarget’s location to this vector each frame.

This will yield a more realistic creature movement with “pathfinding”. The pathfinding can sometimes not match the desired movement occasionally, but the creature won’t be running into objects.

This system is considerably more complex than the original. I implemented mine in C++ and had to take various other steps to ensure it worked properly. I figure most can use this as a starting point and diagnose those issues in their own way, but I can share my solutions to various problems if needed.

If you’re somewhat of a perfectionist, I suggest looking into various methods to replace/compliment this system, such as proper pathfinding (like the suggested A\*) or using a custom movement component (I use [this](https://www.unrealengine.com/marketplace/en-US/product/general-movement-component?sessionInvalidated=true), but it is possible to make your own with some extensive C++ knowledge). However, this works for me thus far, so no need yet to dive into custom pathfinding.

Hopefully this proves a little more useful!

---

<div class="post-metadata">

**Author:** ![cyril.ib](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cyril.ib/32/1102916_2.png) [@cyril.ib](https://forums.unrealengine.com/u/cyril.ib)\
**Post date:** [March 31, 2026, 4:11pm UTC](https://forums.unrealengine.com/t/turning-radius-for-ai/148241/20 "2026-03-31T16:11:56Z")

</div>

Hi! I might be a few years late, but I’ve developed a plugin on Fab that uses curves for path following while maintaining the original pathfinding. By simply changing the AI Controller base class, it adds a ‘turn radius’ (named differently in the plugin) that you can customize for each AI type. I believe this is a close solution for what the OP was looking for.

Here’s the Fab link if anyone is interested:

> **[Enhanced AI Movement](https://www.fab.com/listings/cec55621-2a99-4072-a04d-fbb037eb6b3f)**
>
> Enhanced AI Movement is a set of tools designed to make your AI movements smoother and more natural. It generates customizable splines (instead of straight lines) for AI trajectories, making their movements more realistic. The Quadruped and Biped IK...
