I’m using the Behaviour Tree Move To task so that my NPC can walk to a tree, ready to cut it down.
The problem is that the NPC refuses to walk to the location of the tree, because the exact vector would put them ‘on top of’ the tree, which is an inaccessible route.
I could of course have them navigate just below the tree, but this is a weak solution because forests can be thick, and the tree may only be accessible from above/left/right etc.
Before I code some awkward solution which tries various points in a circle around the tree, is there something built in which can tell the NPC to walk up to the vector, and not worry if it can’t stand perfectly on it?
Not sure if I understand your setup, but maybe setting the goal point at the base of the tree and setting “Allow Partial Paths” to true could do the trick. Also, make your acceptance radius bigger so that they can actually finish their path before they get stuck on the tree.
You can also use the Environmental Query System to find the closest point to your desired goal. This would provide the most accurate result (but it might also be the heaviest one).
My last idea is to add a Nav Area around the tree and set it to an obstacle (or create a new Nav Area Class to make it more customizable). This way, AI will avoid the trees, but if they have no other choice, they will enter the obstacle area. Just remember, it might cause your AI to go through a tree in some cases if the AI thinks it’s their best option. I like this approach because you can also create customizable filters for the AI so they, for example, can’t use the Tree Nav Area, or just treat it as a normal path.