Hello,
So I've got some cars, they're supposed to drive a random route. The problem is, is how do I get the cars to stay on the roads.
Is it only possible using something like: getOneObjectAtOffset(x,y,road.class), or are there better ways of doing this?
Thanks!


First we're at X, on the red road segment.
The segments coming off X are 1 and 2 (the blue segments).
Off each of the blue segments, see what comes off those (the green segments).
We can discard sections 3 and 6 as they are basically dead ends.
We then look at the segments coming off 4 and 5 - 7, 8, and 9 (the yellow/orange segments).
We can, of course, discard 9.
As we can see O's segment is 7, which we've made it to, we're now nearly done!
So we found two routes to get from X to O: