Search Unity

Path finding in a tunnel system

Discussion in 'Navigation' started by Lilcolombian, Sep 2, 2017.

  1. Lilcolombian

    Lilcolombian

    Joined:
    Jun 1, 2017
    Posts:
    15
    I have a tunnel network and I have a robot movng through the tunnels ( think the robots fro the matrix), I need to somehow implement pathifinding in the tunnels. I cant seem to find anything in the forums about navigating a 3d space, most things that are "3d" only refer to walking, I have almost spacelike movement. Anyone know how I could start with this?
     
  2. eXonius

    eXonius

    Joined:
    Feb 2, 2016
    Posts:
    207
    NavMesh on invisible planes in the air might be something that works? or just implement your own solution. You could divide your world into a 3D grid for example and use A* pathfinding.

    It might also be that you'd only need to create some checkpoints for the robot to pass and then connect them in a graph so that you could easily find which checkpoints to pass to reach your goal (can use A* for that too). Then you'd just make the robot head towards the direction of next checkpoint and use collision avoidance to steer away from obstacles.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Navmesh can support rotated surfaces with the github version (hopefully to be accessible once they have sorted out packman). So that's from 5.6 onward. It could do this but I strongly advise you don't use it for that purpose as it's a bad fit and will cost a lot of time trying to get it to work for flying through matrix like tunnels.

    Instead I would recommend nodes connected to each other loosely, and run that through a very classic A* routine. This is by far a better bet than using navmesh for this particular scenario.

    The heuristic is likely to be a dot product + sqrMagnitude for 3D space navigation (if I'm understanding you right).