Nearest from special path

How can we find the shortest path between two point if passes across the points we want?

Hello ,is anybody here ?!

Hi

Sorry for the late answer.
That sounds like you should calculate the shortest path from A to B and then from B to C. If you have an agent, I would recommend first setting the destination to B and once it reaches B you change the destination to C.

1 Like

thanks, good idea but there are many points
Consider a stealth game, for example - go through places that are not in the sight of the police (raycast …)
1-Is there a way to penalty the areas that are in the sight of the police?
2-Is there a way to create a penalty less than 0 ,that is easier to cross in these areas than the whole environment?

  1. You could use an ITraversalProvider to add a dynamic penalty. See Utilities for turn-based games - A* Pathfinding Project
  2. No, but you can make the default penalty for regular ground be higher than zero. That will give you essentially the same result.
1 Like

Thanks
How can we find the points of police’s sight so that we can give them a penalty?

Hi
Does anyone have an answer?