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)?
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?
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?
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.
as soon as i can i put a screen to the behaviour tree and all the functions
Yes it worked! Many thanks!
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.
Glad to help! Don’t forget to upvote the answer so it shows as resolved. Cheers.
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 .
I think it’s hard-coded to the character class. Maybe you can post a request on making turn speed editable.
Okay, found it: it’s called rotation rate and the defaults are X:0 Y:0 Z: 360
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.
Can you show me a screenshot of your node setup? I might be able to see what could help.
Tnx, but I already managed to found out the problem, now it work perfectly.
Tnx again
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.
Thanks my man!!
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
Hey man, old thread, but how did you fix it?