Here is how we do it. You can use this snippet as a basis for your own puzzle or with “exec script”
Hi Yuri,
Thank you so much for the snippet!
After reading through it, as far as I understand, bounding trees is where the magic happens, and then performing closestPointToPoint to find the closest point on the edge of the collision mesh relative to the current position. That’s awesome, being able to query against the outer bounds of the mesh…
Are bounding trees completely supported already in 4.8.0?
I was afraid they would not be available in 4.8.0 (which we’re currently using as a stable production version) but after testing I was able to see the data on my collision mesh and even performing closestPointToPoint() on it. I guess I still have to figure out the correct parameters and the details, but if this works it would really mean a huge improvement for non-physics collisions.
I might try to just exec a short part of code with the collision mesh and current position as parameters and feeding the returned vector to the navigation loop.
Thanks for pointing this out and good luck with 4.9!