Another spherical world issue


#1

Hello! Recently bought the full version as I saw some topic and some videos that it should work on spherical planets. The example beta that features the spherical test is missing the main mesh.


I’ve sorta got it working using a mesh nav mesh, and now I’m wondering what all the colors are? I’ve got the recalculate normals enabled, and without it, it looks like this
Will experiment more with having agents there.
Thanks.


#2

Hi

Spherical pathfinding is very experimental at the moment and not officially supported.
For spherical pathfinding you should have recalculate normals disabled, otherwise it will try to recalculate the normals of the triangles with the assumption that the up direction is along the positive Y axis, which is incorrect for a spherical world.
Your second screenshot looks good.


#3

Thank you so much for your reply.
Couple questions, can I scale the navmesh uniformly, or would I have to regenerate it, if the planet started scaling?
And for making unwalkable areas, the mesh gotta have holes in it, yeah?


#4

Yes, you asked about that in your other post.
It’s an O(n) operation though, so it’s not intended to be used every frame or anything like that.

Yes, the mesh should have holes in it.


#5


Thank you so much, this works like I wanted it to. Thanks for a great asset once again.


#6

Awesome!
Also, if you feel like supporting the package even more, a rating and or review in the Asset Store helps a lot :slight_smile:


#7

You bet, wonderfull support as well.


#8

Hello again @aron_granberg

        var graph = path.data.navmesh;
        graph.scale = 300;
        graph.rotation = new Vector3(-90, 0, 0);
        graph.offset = Vector3.zero;
        var transform = graph.CalculateTransform();
        graph.RelocateNodes(transform);

This sets the scale on the nav mesh indeed, however it doesn’t update it before I actually call or press Scan. Is this intentional or am I missing a call somewhere?


#9

Hi

You have to Scan it once first to generate the nodes, but then calling RelocateNodes should update the existing nodes’ positions.


#10

Not the behaviour I’m seeing. I can see in the inspector that the scale is set to 300, but I have to press scan manually to get it the right scale.
I’ll update to the latest, non spherical beta version, and report back.


#11

Hello again, I’m sorry for the forum spam.
I’m basically having some issues with multiple navmesh areas overlapping. https://streamable.com/gg4bl
Using the TargetMover script, it sometimes selects the nav mesh underneath another navmesh, and I’m worried I can’t really fix that as there isn’t a “on top” since I’m using spherical worlds.
Any suggestions?


#12

Hi

For your mesh to work as a navmesh it needs to be a connected surface. A navmesh is defined as all surfaces where the character can walk, and the character is allowed to walk through connected triangles in the mesh. It looks like you have multiple disconnected surfaces there.