Search Unity

Ideas on Best way to handle a Junction Situation

Discussion in 'Navigation' started by Reddevildragg, Jul 13, 2020.

  1. Reddevildragg

    Reddevildragg

    Joined:
    May 19, 2014
    Posts:
    50
    Hi all

    Just wondering if anyone has some nice ideas on how to handle a road junction situation for pedestrians to wait for a traffic signal.

    I had a solution working with 1 junction with the road marked between walk able and un-walkable and then just swapped it with the lights. however when scaling up to multiple junctions around a block when the road was off the agents would start walking towards one of the junctions that was one that would ultimately get them to the same destination (be it crossed 5 roads instead of just waiting for the lights).

    Trying to think of the best way to have the agents get to the crossing, cross if they can and if not wait for the light rather than taking the massive detour (which constantly switches as the lights change). Had the idea of marking the area around the crossing where they wait to set a flag on the agents script to stop them trying to get places, But this also has problems if an agent walks though the zone to avoid other agents but does not have the intention of crossing they just get stuck in the zone.