M
M
Morgenstern Akhmedovich2021-08-29 14:33:41
Unity
Morgenstern Akhmedovich, 2021-08-29 14:33:41

What is the best way to avoid obstacles?

Hello, I have a flying 3D player. It is necessary that enemies fly in front of him, flying around static and moving obstacles. What is the best fit for this? I have no idea how the enemy will use Raycast to determine objects and, most importantly, fly sideways to the right distance from them. Maybe there is some more appropriate way? Is it possible to use the NavMeshAgent for this, and if so, how to make the object not turn and fly in the turned direction, but just move sideways.? Can I somehow track through the code when the NavMeshAgent is going to fly around the obstacle and process this data? Or abandon NavMesh and use something else? Or is it easier to just score and take these enemies to ***?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2021-08-29
@Griboks

Usually enemies fly through each other. If the enemies are large or there are many of them, then it is enough to prescribe a simple algorithm like: "we fly around the obstacle towards the target."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question