I had an idea for a game concept that I'm creating right now, and... well it doesn't work the way I wanted.
First, let me explain my idea.
I have some kind of building simulation game project, and I wondered how I could check that House A is connected by the road to Service A, for example. Before you tell my how you'd have done this, I figured something out but it involves pathfinding, something I'm not familiar with at all
. Here is it :
Here, the grey tiles are roads, H are houses, and W is the service. Two houses should be considered as "connected" to the service tile, and two shouldn't.That's what I wanted to do.
So, I generate solid objects by the edges of the tiles, and destroy the ones between two roads or between a road and a H or W tile.
Then, I could find a path between the Houses and the service. But whatever settings for pathfinding I use, the houses keep ignoring the obstacles. I searched everywhere and the documentation about pathfinding is quite hard to find IMO.
So here I ask for help. I have two questions:
1. Is it a good idea to check connection between to objects through other objects using the pathfinding behavior?
2. And more important, why is it not working?
Here is the download link for the capx file : https://www.dropbox.com/s/d6j5k51y3jlsep6/pathfinding_constructforums.capx?dl=0
Use the mouse and the H, R and W keys to create Houses, Roads and Wells. I added a "follow path" action for testing purposes, but of course here I'm only interested in the "find path" action.