Formation packed for spherical worlds

I am currently using formationpacked to move multiple units and then reachedcrowdedendofpath to stop them and it is generally working quite well. One thing I noticed though is that the nativemovement plane I pass to the function is always distributing the functions on an XZ plane and not on a plane with the navmesh. In the documentation nativemovement plane is a variant of simplemovement plane which is described as having functions to convert the XZ plane points into points on my surface. I am currently just getting movementplane like this and passing it to formations packed.

image

How would I utilize the nativemovement plane functions to get it to return the formation relative to my navmesh?

Hi

The NativeMovementPlane is not a component. I’m not sure how that code would ever work. Possibly it just returns you a default movementplane.

However, you can get the movement plane from the agent:

var movementPlane = ai.movementPlane;

That will allow you to do what you want.

However, this will likely not work great if your different agents have movement planes that vary significantly from agent to agent. In that case you’d need a more complex implementation of FormationPacked, which is not part of the package.

Rather than using the agents plane I was able to set my destination marker as a Follower Entity, use teleport to move the object on right click, and then use the movement plane of the destination object. Though it takes a moment to right itself so I have to double click for now.

From there it creates the formation on the plane the object is on, but doesn’t wrap around if the plane curves. I am assuming to do that would require the more complex implementation you are talking about.

Overall movement and local avoidance is working perfectly on a 3D world with changing normal planes, but determining how to stop is tricky. reachedCrowdedEndOfPath works great at the end but every so often triggers early on a plane change. Trying to differentiate between a false trigger early to get them walking again while not making them walk in place on completion is proving to be a challenge. Do you have any advice for determining how to stop on non-planar worlds?

It’s quite tricky when there’s a lot of curvature changes. If you can have smoother direction changes in the world, it will get more accurate.