Setting Rotation for an A.I

Hi, So I am currently developing an A.I guard, I have currently set up one condition using a behavior tree and a target point

Which is Move to this point (shown here)

But the problem is the AI guard walks to the location but just stares at the door (like so)

I want him to turn and face the opposite direction any ideas how I make him do a 180 ?

Anyway u can show me what that looks like ? (if u have the time)

After he reaches his destination you can set his rotation opposite of the guard position by using his lookat rotation to the target point and then reverse it.

This should do it, let me know.

I didn’t have time to setup a target point or anything else so I used a random reachable point in radius but instead you would use the target points location and the controlled pawn is the AI pawn.

see the problem is I am using move to in the behavior tree ?

Here is what I have in my behavior tree

Where would I set such a task and what would that task blueprint look like ?

That is a screenshot of a move to task in a behavior tree task that I setup, it should work no matter where the moveto task is whether it is run from the AI character event graph or in a BT moveto task. If you are just using the simplified MoveTo task node in the BT, then you can make a new task that will set the rotation after the move to is successful by clicking on the NewTask button at the top of the BT editor window and creating the rotate actor task.

You would run the task after the move to was successful or create a custom moveto and rotate task combined. To create a new task:

82364-btnewtask.png

And its graph would roughly look like this:

Running it after the moveto that you already have would look like this:

That should get you in the right direction.

Hey thanks for your help but, one last question : how to I get reference to the target point (I cant seem to figure it out at all) ?

The same way the moveto is getting it, it should still be in the black board so use a get black board value as vector and grab the key name for the target points stored vector.

Check this link as well …