# Ai rotation problem

**URL:** <https://forums.unrealengine.com/t/ai-rotation-problem/296215>\
**Category:** AI\
**Tags:** ai-navigation, behaviour-tree, unreal-engine, question\
**Created:** [October 15, 2014, 3:04pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215 "2014-10-15T15:04:42Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vittix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vittix](https://forums.unrealengine.com/u/Vittix)\
**Post date:** [October 15, 2014, 3:04pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/1 "2014-10-15T15:04:42Z")

</div>

I’m trying to create an AI for some animals that wander around.  
We have created a navigation area and set a behaviour made of 2 moments:  
1 - the search for the place to reach  
2 - move tree basic function (move to)  
Everything works, but what I don’t like is that every time the animal looks for a new place to move to he doesn’t move smoothly but just twitches to it before moving.  
Is there a way to make the wandering smoother (for example turning slowly to the new objective before starting walking again)?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 15, 2014, 5:58pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/2 "2014-10-15T17:58:06Z")

</div>

Hi Vittix,

Have you tried using an rinterp to lerp between the rotation the AI began to the rotation of the new movement before it moves?

---

<div class="post-metadata">

**Author:** ![Vittix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vittix](https://forums.unrealengine.com/u/Vittix)\
**Post date:** [October 15, 2014, 6:57pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/3 "2014-10-15T18:57:51Z")

</div>

i don’t know exactly where to do that, should i do inside the same task that find the point to reach or should i create another task to put between the search a new point task and the move to task? plus the ai just know where to go but how do i retrieve the new rotation that look at the point the actor should reach?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 15, 2014, 7:07pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/4 "2014-10-15T19:07:46Z")

</div>

I would put this in the actual move to location script. Before moving, put a set relative rotation node, with an rinterp of the ai rotation to the new rotation. Can you post a screenshot of your functions here? I might be able to more clearly understand what is going on and what could be most helpful.

---

<div class="post-metadata">

**Author:** ![Vittix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vittix](https://forums.unrealengine.com/u/Vittix)\
**Post date:** [October 15, 2014, 7:10pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/5 "2014-10-15T19:10:20Z")

</div>

as soon as i can i put a screen to the behaviour tree and all the functions

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [October 16, 2014, 4:01pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/6 "2014-10-16T16:01:07Z")

</div>

Hey there, I’m assuming the parent class for your AI animals is “Character”. If so, you should check the “Orient Rotation to Movement” box and then uncheck “use controller rotation - yaw”. Then you can use “Simple Move To Location” for smoothly rotating pathfinding animals.

---

<div class="post-metadata">

**Author:** ![Vittix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vittix](https://forums.unrealengine.com/u/Vittix)\
**Post date:** [October 16, 2014, 4:24pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/7 "2014-10-16T16:24:16Z")

</div>

Yes it worked! Many thanks! 🙂

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [October 16, 2014, 5:37pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/8 "2014-10-16T17:37:37Z")

</div>

Glad to help! Don’t forget to upvote the answer so it shows as resolved. Cheers.

---

<div class="post-metadata">

**Author:** ![DaveHall17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DaveHall17](https://forums.unrealengine.com/u/DaveHall17)\
**Post date:** [January 22, 2015, 6:23pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/9 "2015-01-22T18:23:10Z")

</div>

Thanks for the answer . I had a similar problem and it is a definite improvement .

Do you know if there is a way to change the speed that the character rotates ? I tried changing the character movement speed and the character acceleration / deceleration , but it does not seem to make difference .

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [February 8, 2015, 6:14am UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/10 "2015-02-08T06:14:28Z")

</div>

I think it’s hard-coded to the character class. Maybe you can post a request on making turn speed editable.

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [February 11, 2015, 1:02am UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/11 "2015-02-11T01:02:06Z")

</div>

Okay, found it: it’s called rotation rate and the defaults are X:0 Y:0 Z: 360

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d973a2dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d973a2dd](https://forums.unrealengine.com/u/anonymous_user_d973a2dd)\
**Post date:** [October 27, 2015, 10:43am UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/12 "2015-10-27T10:43:49Z")

</div>

Hi, i have a similar question, and since this question is not market closed, i will write here.

I want to make a BT task dedicated to make my character turn to get a particular rotation or face a particular point in space.  
I know there is already the “Rotate to face BB entry”, but it does’nt seem to work correctly, it makes the character to turn istantly.

I’ve already found RInterpTo, but probably I’m not using it in the right way.

Any help?

EDIT: Just to be clear, I’ve checked the “Use controller rotation Yaw”, and my character “Base turn rate” is 1…  
I’ve noticed that unchecking the first option, my BT get stuck on the “Rotate to Face BB Entry” task.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 27, 2015, 5:57pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/13 "2015-10-27T17:57:16Z")

</div>

Can you show me a screenshot of your node setup? I might be able to see what could help.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d973a2dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d973a2dd](https://forums.unrealengine.com/u/anonymous_user_d973a2dd)\
**Post date:** [October 28, 2015, 2:06pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/14 "2015-10-28T14:06:41Z")

</div>

Tnx, but I already managed to found out the problem, now it work perfectly.  
Tnx again 😉

---

<div class="post-metadata">

**Author:** ![wmassingham](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wmassingham](https://forums.unrealengine.com/u/wmassingham)\
**Post date:** [October 22, 2016, 9:58pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/15 "2016-10-22T21:58:38Z")

</div>

Thanks! For reference, “Use Contoller Rotation Yaw” is under class defaults, and “Rotation Rate” and “Orient Rotation to Movement” are under the actor’s movement component.

---

<div class="post-metadata">

**Author:** ![blender\_black](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blender\_black](https://forums.unrealengine.com/u/blender_black)\
**Post date:** [January 17, 2018, 2:25pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/16 "2018-01-17T14:25:27Z")

</div>

Thanks my man!!

---

<div class="post-metadata">

**Author:** ![Majda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Majda](https://forums.unrealengine.com/u/Majda)\
**Post date:** [August 31, 2018, 4:05pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/17 "2018-08-31T16:05:09Z")

</div>

I found a solution without unchecking box “use controller rotation - yaw”  
In behavior tree, on move to , Check Box Allow Strafe.  
I worked for me 🙂

---

<div class="post-metadata">

**Author:** ![VioletSaint](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/violetsaint/32/88710_2.png) [@VioletSaint](https://forums.unrealengine.com/u/VioletSaint)\
**Post date:** [June 10, 2019, 3:48pm UTC](https://forums.unrealengine.com/t/ai-rotation-problem/296215/18 "2019-06-10T15:48:14Z")

</div>

Hey man, old thread, but how did you fix it?
