I made Local Avoidance of Obstacles work on a Spherical World!

@aron_granberg. Hopefully I’m not repeating old news but I have been trying to figure out how to get my AI to avoid obstacles on a non-planar surface (my spherical world) for years now and It was so simple and I won’t be surprised if it’s already been figured out but by the looks of the forums, it hasn’t. Let me first start off by saying what i’ve tried in the past. I tried to do navmesh cut but that does not work on non planar surfaces. I tried to use raycast but that won’t work for large obstacles like buildings or boulders. I gave up for a year. Then said “F*** it!” I ain’t done trying. I slapped a RVO controller on my buildings but immediately gave up realizing that the controller only works with Y-axis UP. But wait! How does my AI NM controller follow its local axis up but my Building NM controller wont? Then it clicked! AiPathAlignedToSurface!!! Something in that script shifts even the NM controller’s Y-axis to the local player’s axis. BOOM!!! I slapped that script on there and just made my building static and disabled any movement on the scripts and done.

1 Like