How do I make a one directional path in path finding :?
I'm sure that would be tricky. The path finder works on its own grid system, and only updates the system with locations of solid objects once. You would have to keep calling the update action to update the grid, which is time consuming.
If that wasn't an issue (for example, the layout is small), then (assuming a "player" object of some type is involved) one way might be to create a very thin and LONG rectangle positioned behind the player, longer than the height or width of the layout, mark it solid, call the "regenerate obstacle map" action, then "find path". I assume it would only look ahead of the player.
Another option might be to create a bunch of semi-transparent blocks filling the empty space, the set all blocks in the "wrong" direction to either solid, or with a path cost, then update the obstacle grid, then find path.
Or option 3: Write your own if possible. ;)
Develop games in your browser. Powerful, performant & highly capable.
I was thinking for a road with traffic