Movement in a straight line. Search for points

I have integrated the library into my scene.The library is good, but very complex. I have a few questions.

In the Grid Graph, objects move along an arc (polyline. Not a straight line) on a plane without obstacles. Tried modifiers. In the examples, this is also the way to move. I use the AILerp script. In the examples, AIPath. Is it possible in the Grid Graph to make objects move in a straight line when there are no obstacles?

In Navmesh Graph, they move in a straight line. I did not understand how to make obstacles here. Do I need to make obstacles with one mesh in the editor right away? If so, are there a couple of ready-made objects in the “max” format somewhere?


I drew a picture. There are several objects. They form a group. They learned to walk in formation. But I cannot make them turn relative to each other.

How to find the coordinates of the points shown in the figure?

Hi

If you use the RaycastModifier, it should simplify their paths to be straight lines when possible.

The primary way to make obstacles for a navmesh/recast graph is to use the NavmeshCut component.

I did not really understand the question about formations?

This mechanic is used in tactical RPGs. I have never seen such games on Unity. The movement of a small detachment along a given trajectory. At this stage, there is no difference from the mechanics that are used in real-time strategies.

Each member of the squad is in a given cell. This I was able to do. https://youtu.be/XLFcrhQOCvo
I cannot deploy the squad. I don’t know the way. I would be grateful for any advice.

RaycastModifier is what you need. Thank you.

I solved the problem. Used quaternion and direction vectors. Four lines of code for each point. If anyone is interested, I will write in more detail.

1 Like