Search Unity

How do you handle agents of differing sizes?

Discussion in 'Navigation' started by Nanako, Dec 4, 2015.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    I'm trying to create navigation for a demo that will include wolves and elephants, with understandably different sizes.

    Is there any better way to handle this than just baking for the largest agent size possible? Will larger agents automatically adapt and not try to walk into tight spaces?

    i've got little buildings i'd like the wolves to walk inside, but not the elephants obviously.

    any thoughts would be appreciated
     
  2. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    I dont think unity's navigation suports different agent sizes, it is on the roadmap as one of the future improvements.
    You can try and use some alternative navitation available at the asset store, some of them support this in some way.
     
  3. Crizz92

    Crizz92

    Joined:
    Sep 17, 2015
    Posts:
    44
    I think that just increase the size is the best way unfortunately. That's kind of random, and u should be sure that every building entry is small enough for elephant and large enough for wolfes.
     
  4. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Standard solution is to use different grid/navmesh for every unit size.
     
    Mycroft likes this.
  5. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    @Roni92pl
    This is a novel idea actually. How can i make multiple navmeshes for the same area though, and how can i tell a particular agent which one to use? I need more information here
     
  6. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Well, I didn't said it's possible with Unity's navmeshes, but all high quality pathfinding solutions should have such possibility, look on the asset store.
     
    Mycroft likes this.