Astar Pathfinding check if areas are connected (Please Help!)
Hello all!
A friend and I are remaking Dig Dug for a class project, and we are stumped!
The aim: In Dig Dug, the enemies don't actively seek out the player until the player connects his tunnel to the enemy's. We want to write a script that disables the AIPath script on the enemy, until the tunnels are connected, to recreate this effect.
The problem: We aren't sure how to determine (through code) when the enemy's tunnel connects to the player's.
We tried using the IsPathPossible function. However, this didn't work.
I suspect that the problem with IsPathPossible lies in the fact that our player deletes nodes from a graph as he "digs" -- the deleting acts as opening up "tunnels" that the enemies can path through. A gif of this, can be found here
However, since IsPathPossible only works for nodes, this is a problem... or so I suspect. Please correct me if I am wrong.
Does anyone have any solutions? As I have been looking through the documentation, I get the sense that I may be looking for testing if "areas" are connected? I haven't figured out how to access "areas" in code, although I have gathered that they are the colored shapes that appear in the editor view when running the game.
I haven't a clue, though.
Thanks for the help! I believe in the super Unity Community!
Your answer
Follow this Question
Related Questions
How to know which point that AI picked to move to? (A* Pathfinding) 0 Answers
How do I make AI objects not walk on top of each other? 5 Answers
Moving Enemy Along A Star Path 1 Answer
astar pathfinding with groups 0 Answers
A* finding nearest Object 0 Answers