If the end position is off-mesh, it should look for the closest on-mesh point to it. This should be done on the polygon that is closest to the end position (endRef), not the start position (startRef).
Currently monsters can aggro through walls if the player is off-mesh (i.e. close to a wall), since it finds a point on the start polygon where the monster itself is.
If the end position is off-mesh, it should look for the closest on-mesh point to it. This should be done on the polygon that is closest to the end position (
endRef
), not the start position (startRef
).Currently monsters can aggro through walls if the player is off-mesh (i.e. close to a wall), since it finds a point on the start polygon where the monster itself is.
I affirm: