The technique for detecting obstacles seems straight forward but error prone. I’m casting a ray out of the center of the grid and my first thought is what happens if the wall isn’t centered on the grid.
Is this common practice in unity or is there a better technique? I know we bake navmeshes in many instances, which I guess do more high fidelity checking of the shape of obstacles so I’m wondering if there’s a better technique here someone might be aware of?
I’ve not done this before but I’m wondering if something like adding a collider to the GridSystemVisualSquarePrefab that we check for collisions with obstacles on start and set the collider active false after the check? Perhaps doing a higher sample raycast like 3 or 5 rays per X and Z axis? Maybe setting up some kind of snap to obstacle objects so it always intersects with the square center?
Maybe this doesn’t matter and I’m overthinking it but I can imagine this being a problem.