Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Uni-directional Navigation Mesh

Discussion in 'Scripting' started by imarcellana, Jun 24, 2014.

  1. imarcellana

    imarcellana

    Joined:
    Jun 24, 2014
    Posts:
    2
    Hello,

    I am developing a simulation where I have AI vehicles moving along streets. However, I am having trouble making them move in one direction down what is supposed to be a one-way street. I have tried using off-mesh links with the same and different navigation layers set to the roads, but that approach hasn't worked so far. Any ideas on how to solve this? Thanks!
     
  2. karljj1

    karljj1

    Joined:
    Feb 17, 2011
    Posts:
    440
  3. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    403
    Block the road with a dynamic NavMeshObstacle object, wen setting the target position of the vehicle.
     
  4. imarcellana

    imarcellana

    Joined:
    Jun 24, 2014
    Posts:
    2
    I tried the off-mesh links with bi-directional turned off and it didn't work for awhile until I realized that the height value needed to be increased. We were toying around with the idea of having the off-mesh links cover the entire street, but it seems as if the object moves with an "unnatural" speed.

    @Magiichan what components and attributes would I give the dynamic NavMeshObstacle object?
     
  5. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    403