How to avoid big agent to overlap obstacles

Hello.
Since no one has unsubscribed, it means it’s not easy. I’ve already done about this. It was necessary to stop the warrior within striking distance.
Here is the algorithm.

  1. First you check the availability of the path to the port.
  2. If the path is not available, find the end point of the path. This is the point where your ship is currently in the picture.
  3. Find the previous point. But it’s not perfect. It may be necessary to find the point following it, but I did not do this.
  4. Look for the direction vector. From the end point of the path to the previous point.
  5. This vector is multiplied by the distance you need. You add the resulting vector to the end point of the path. This is a new point and there is what you need.

Here is my example.
https://forum.arongranberg.com/t/how-to-go-to-the-neighboring-node-is-there-an-easy-way-to-colorize-a-line-renderer/12743