I am implementing A* algorithm with obstacles tagged as Obstacle. I have a Board class that holds a grid of Nodes - discretized Plane ‘tiles’ with its coordinates.
I need create a map of walkable/unwalkable Nodes with collsion detection. What I came up with is :
Create a temporary GameObject with BoxCollider and keep translating it from one Node in the Board to another and check everytime if it collides with anything with Obstacle tag.
Now how can I do it if I do not have a single OnCollisionEnter() (or other function for collisions) but I have :
- a plane with pathfinding script attached
- many
Obstacles - temporary
BoxColliderwhich I do not know where to create (in which script)
How should I do this ? Where to perform this collision checking ? I think I can create a flag that would indicate whether the walkable/unwalkable map needs ‘rebuilding’.