Hello,
I’m currently setting the transform.position of a building as the target for some units. This can lead to some funkyness, as instead of walking directly to the building say 5 units away, it might instead walk around some obstacles to get to the other side of the building because that point on the building is closer to transform.position than the part of the building closest to it.
That is to say, because the model of the building is in the obstacle layer, it causes the pathfinding algorithm to find the point on the building closest to (usually) the center of the model. (I think)
I’d like to have the algorithm return success when it finds the shortest path to any part of the building - I would think this could be done by passing the game objects collider to the algorithm. Is something like this possible?
I know this is done in pretty much every game out there, but maybe I’m not approaching the problem the right way. Any tips are appreciated!
Thanks,
Chris