Search Unity

Unit Collision Avoidance: how to “push” friendly units aside?

Discussion in 'Navigation' started by Modus_Pwnens, Nov 4, 2017.

  1. Modus_Pwnens

    Modus_Pwnens

    Joined:
    Oct 24, 2017
    Posts:
    4
    In Starcraft2, a unit directed to move through a crowd of friendly units will follow a straight line through the crowd while the units are "effortlessly" pushed aside. I am trying to replicate this behavior using Unity's built-in NavMesh System.

    At first I created an enum of states: { IDLE, ENROUTE }; I put a sphere collider on each unit and OnCollisionEnter() I had the unit "jolt" out of the way.

    But this approach isn't exactly what I want. How can I have a game object move through a crowd of other game objects of the same type and simply push them out of the way, without hampering the speed of the unit en route?

    I am looking for general, high-level strategies if not specific implementations.