Search Unity

Using Unity to find best object moving path inside a building?

Discussion in 'Navigation' started by glenncai, Feb 6, 2019.

  1. glenncai

    glenncai

    Joined:
    Feb 5, 2019
    Posts:
    4
    Hi, Everyone
    I'm a BIM modeler for facility management and never use Unity.
    I need to find out if is possible to move a large object to its target location in the building without hitting any walls and columns.(Please see attached image)

    My goals are:
    Find out if is possible to move to the final location(object can be too large)
    if yes, generate the best moving path with minimum object rotation needed.

    I know the Unity has some build-in feature for path-finding, so I'm wondering if this is a right software that I can start with to solve this kind of problems. Any suggestion and tip will be very appreciate. and please feel free to ask any questions. Thank you!
     

    Attached Files:

    • Path.JPG
      Path.JPG
      File size:
      202.4 KB
      Views:
      648
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Yes, this is exactly the type of thing the NavMesh system is built for.
    You simply bake your building as a Navmesh with the walls in mind, set up an Agent with the correct dimensions you have in mind, and then give said agent a destination.
    For a step-by-step guide, see this tutorial series here.
     
  3. glenncai

    glenncai

    Joined:
    Feb 5, 2019
    Posts:
    4
    Hi, Yandalf
    Thank you for reply. This is a very good starting point for me.
     
  4. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Someone correct me if I am wrong, but I think Unity's pathfinding assumes a cylindrical collision volume and thus doesn't take rotation into account. So an object like in the image above that is very skinny and long probably won't get a very accurate solve.
     
  5. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    You're right about that. You'll probably have to write your own agent in case you're dealing with agents that don't fit inside a standing cylinder. Alternatively you can set the agent's cylinder size to the largest size of your block, making it impossible to get into nooks and crannies.
     
  6. glenncai

    glenncai

    Joined:
    Feb 5, 2019
    Posts:
    4
  7. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Unfortunately no, if you need to solve things this way you'll have to roll your own solution. You could take a look on the asset store, but I don't know if anyone's ever made an asset for this kind of planning.