# Getting ai agents to all face common directions without rotating at end of path. [RTS Help]

I have multiple agents that have a definite front and back to them.

My current solution has my agents stopping at the destination correctly, but they stop at odd angles, which looks very disorganized.
I what to have my agents all face a common direction, one of the cardinal or intermediate directions (n, north east, east, south east, south, sou west, west, north west).

My current system determines direction to face (based on angle to target from start node) and then rotates my agents to face that direction. As you can guess, this looks very unnatural (as my agents represent space ships and this is normally not how ships are seen to move).

My guess on the solution to this has to do with modify the path so when I end at the goal node, I’m facing the correct direction (which is how naval ships and cars and such all move to face directions).

How would I do this or implement is? I am unsure of how to start and how to actually modify the path. I know e path in the ai script shows it is an array of vector3 objectsn(representing positions of each node in the path) but I am unsure of how I am to account for all directions and such.

I cannot give you any example code here since I am away at the moment. But look at bezier curves. The simple smooth modifier has an option for bezier curves, you could modify the tangents of the end points to match the desired rotations of the ships.
The bezier modifier (simple smooth) will simply use the direction of the last segment as the last tangent, you should change that to be the correct rotation.

That’s pretty ingenious. I am new to bezier curves and tangents, so I am unsure of exactly how to manipulate this. Could you demonstrate this in script when you get to a workstation?

I also decided that i wanted the end direction to be about the direction it was facing when it approached the end node. Here is an example:

This prevents very jerky curves near the end and sudden rotations (which look unnatural). I obviously would then make these angles be binded to certain angles so that angles look organized amongst groups of agents.

Any ideas on how i can achieve this? I am unsure of how to proceed by modifying this the bezier curve.