Navmesh on a spherical planet

The image that @rey4033 is showing is the default unity NavmeshComponents automatic nodelink placement. Where it automatically places nodelinks on the navmeshes.

Sure. But I’m not sure how it related to spherical worlds.

In any case, automatic node link placement is not on the road map at the moment.

@rey4033 If you are looking for automatic navmeshlink placement on unity’s newer navmeshsurface there is a tool i helped work on… can’t say it’d work on spherical services at all but it would work great on your picture

https://forum.unity.com/threads/navmesh-links-generator-for-navmeshcomponents.515143/

Thank you for giving me this link.:grin:

alternatively if you are wondering if the a* spherical navmesh would generate a singular names on your example pic I suppose it could if:

  • It was one mesh (not several cubes and a plane)
  • doesn’t have hidden faces (such as the hidden sides of the cube touching each other)
  • the hard corners would be a problem for the AiPath. I think it would result in them simply falling off the edge, but possibly something you could easily overcome, or smooth the edges

Hey guys,

I know I’m a little late to the party, but I had already been working on a port for the Automatic link generator targeted at A* PP. But also wanted to add some additional features like placing one directional links for locations where the Agents could jump down, but not up.

It’s not completely bug free, so feel free to contact me if you need help.
You can find the code here: https://gist.github.com/WolfVanH/e2ecbb34d6f2648005e68bec075022ef
Currently works with NodeLink2, though it’s easy to change that in the code.
This code definitely can use some clean up. I’ll update the gist if I get around doing so.

You just need to make 2 prefabs NavmeshLink prefabs, one being with one way enabled.
Place the script on any object in the scene. It should generate the Navmesh links when the graph is being scanned.

The original script was made by eDmitriy with improvements made by @Christougher.

-Wolf

2 Likes

It’s so powerful. Thank you!:grin:

1 Like

Very nice! I’ll check this out when i get a chance. We should probably make a separate thread for this so people can find it. Awesome.

1 Like

Hey, guys, why do I get these errors when I use the 4.3.11 pro?:flushed:

@rey4033 Are you using Unity 2019.3? It looks like you are using an older version of Unity.

What is the best way to avoid obstacles (trees, big stones) which spawns in random places on spherical planet?

Do these objects spawn on start or randomly throughout the game?

If they spawn at start you could just wait to scan the graph till all the obstacles are spawned.

Yes, they spawns on start. I use A*pathfinder first day : o, where i can read or whatch some examples about scanning the graph? Graph = navmesh? if its true… in spherical world we can use only precreated mesh for navmesh, how AI will understand that the Stone (wich is another mesh) is the obstacle?
Thanks

I’d recommend checking out the Getting Started page. Graphs are what we call navigation ‘areas’. Navmesh is a polygonal mesh to represent a walk able surface.

If you want to simply call scan from your own script you can do something like:

public virtual void OnGameReady()
{
    AstarData.active.Scan();
}

Maybe i have incorectly described situation :slight_smile:


i have 1) Player
2) Obstacle to avoid
3) target to move
4) Spherical Navmesh
so obstacle (2) is not included to sourse mesh. But i need to avoid it

You might be able to use the Navmesh Cut component on your wall. Though I’m not sure which modifiers work with the spherical navmesh graph.

So [aron_granberg] said that we cant use navmeshCut on spherical navmeshes

1 Like

hmm, ye fair enough, I don’t have any experience with the spherical tools.

I read back through the posts a little;

You could write a graph modifier that does a custom collision check for each node based on the code linked above. Set the walk ability to false for those nodes that failed the collision test.

1 Like

Hello,Aron,When I Click this ‘Apply’ Button,it shows these two errors,how can I settle down these errors?:flushed::worried:

And how can I settle down these AI errors when it walks on the Inclined plane?

wrong7