Search Unity

  1. How can our website serve you better? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

Multiple NavMeshAgent moving to the same point

Discussion in 'Getting Started' started by DEV971, Oct 11, 2018.

  1. DEV971

    DEV971

    Joined:
    Oct 25, 2017
    Posts:
    26
    The typical RTS where you select multiple units and make them move to an arbitrary point.
    How do you avoid them colliding each other once they get close enough?
    I've been playing around with Rigidbody properties but no luck.
     
  2. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
    Edit the layer collisions in edit > project settings > Physics/Physics2D
     
  3. DEV971

    DEV971

    Joined:
    Oct 25, 2017
    Posts:
    26
    Hey thanks, if I understand correctly what you say is I must assign the units to let's say a layer "Units" and then there tick the checkboxes like this?



    Not sure if that's how it is supposed to be but tried it and it doesn't work, they are still colliding/bouncing each other
     
  4. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
  5. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
    thats the documentation for that
     
  6. DEV971

    DEV971

    Joined:
    Oct 25, 2017
    Posts:
    26
  7. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
  8. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
    well then im not sure
     
  9. DEV971

    DEV971

    Joined:
    Oct 25, 2017
    Posts:
    26
    anyone else?
     
  10. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
    actually there is another way
     
  11. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    362
  12. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,784
    Most RTS games cheat. When you assign a bunch of units to move, they don't all get assigned to the same position. Instead they get assigned to a bunch of positions around that point. Which means that they don't clump and collide.

    The other option is to turn off collisions between them and just let them all move to the same position.
     
unityunity