Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Flying NavAgents

Discussion in 'Navigation' started by plasmabazooka, May 17, 2015.

  1. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    Is it possible to make flying agent which avoids obstacles over certain height but fly over low obstacles?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,550
    It could be possible to do something with the Nav system however if your working with flying entities then a path finding system is not ideal. Try looking into steering algorithms http://www.red3d.com/cwr/steer/
    UnitySteer would be a start :)
     
  3. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    May I know which way to look?
    Have no idea how to do this...
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,550
    You could create an invisible plane to generate your mesh on. Have your low obstacles within the step height/slope value of your Navigation system and the high obstacles over it(or put them on a different nav layer). The problem is your flying object will always fly on a plane and wont really look like its flying.
     
    plasmabazooka likes this.
  5. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    Thank you very much. Those are droids I'm looking for!
    My flying objects fly on same height always.
     
    karl_jones likes this.
  6. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    Have one more question regarding objects like mine.
    If I have several different scales of agents. For example one radius is 8 units and other just 2.
    If I bake with navagent radius 2 units the big one starts to clipping obstacles if I bake with 8 meters the small one starts to fly a way far from obstacles. Is there anything I can do?
     
  7. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,550