Search Unity

Find the closest path for bus game

Discussion in 'Navigation' started by Simon75012, Mar 18, 2018.

  1. Simon75012

    Simon75012

    Joined:
    Sep 15, 2016
    Posts:
    79
    Hi,
    I'm making a bus transit route game.

    -So i have some buses, each bus have is own line.
    -I have some bus stop, a bus stop can have many lines connected.

    Passengers pop at random bus stop and go to an other random bus stop. So some passenger need to change bus once, or twice, or even more...

    I'm trying to make some rules to know if a passenger should go in the bus or wait for an other bus if there is more than 1 line at this stop. The main goal is to have less stops (i prefer to change bus twice and have only 2 stop total than staying on the same bus for 5 stop). The travel time does not matter.
    I have no problem if there is only one connection to make, but above that it get so complicated.

    I have some lineRenderer drawing every bus lines, i was wondering if i can calculate the number of stop with that.

    I hope you can understand what i said :)