Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to make multiple agents move to somewhere BY a point instead of fighting over the exact point?

Discussion in 'Navigation' started by Th0masThe0bvious, Nov 24, 2021.

  1. Th0masThe0bvious

    Th0masThe0bvious

    Joined:
    Aug 22, 2018
    Posts:
    80
    This is a question pertinent to real-time-strategy games like Command & Conquer and Starcraft. Usually those games let you select multiple units and order them to move to a destination. It's pretty convenient to use Navmesh with raycast hits for most orders in this sort of game, but things get problematic when you sent multiple units to one point, because when such an order is given with a single, specific coordinate made every selected unit's destination, they all go and will always be attempting to shove each other out of the way.

    What I need to know, therefor, is how to translate a point into somewhere in the vicinity of the raycast hit whenever this might be a problem, which is essentially any time you've ordered more than one unit to a place.