Navmesh on a spherical planet

Hi, I wanna avoid obstacles in spherical worlds, how can I with this setup?


something like this : https://www.youtube.com/watch?v=xMp-vnOR2yk
I use graph update scene, but I need to configure it manually, is there a better way?
Thanks

Hey,

Spherical graphs do not support any kind of navmesh cutting, so this will have to be done inside your 3D modelling application.

sorry to bother you again but what should i do in 3d? I tried to remove faces, make an extrude or put the obstacles in the mesh but it does not work :confused:

I am trying to create a more straight path to the destination. How can I do this? Is it even possible?
My navimesh model is tessellated similarly to the example one. ( pretty uniform triangle )

@Studio_Pixellore Unfortunately I’m not sure if it can be improved much. On a regular (not spherical) graph it would be possible to use the Raycast Simplifier component to fix this, but on a spherical graph it’s not as easy :confused:

@Owen_Mdvd What you would do is to remove those faces from the navmesh mesh in your 3D modelling application (e.g. blender or maya).

Hello,Aron,because of the project requirements, I need a Rigidbody on my AI and set its iskinematic false.But now it comes a problem is that when the iskinematic is false: 1.The AI will be blocked even the obstacle is so short. 2.The RVOControler on the AI can not be effective(can not avoid the other ai whose body also has a RVOController). How can I solve this problem, I am very urgent.2

  1. I would recommend that you disable collisions between the agents in the project’s physics settings.

  2. The movement scripts aren’t really designed to support non kinematic rigidbodies I’m afraid :/.
    In this case you might be able to use a raycast ahead of the unit that lifts it up if it detects a very short obstacle. Physically it is doing everything correct right now. Pushing a cylinder on that box will not cause it to go over it.

Thanks for your answer.Now I have set Agents’ Rigidbody IsKinematine true,but I find 3 problems.
1.When the agent lands from such a ladder, it’s instantaneous. I hope this action is procedural (like free falling movement).
2.When the player is behind the ladder and the AI is in front of the ladder, the agent goes directly up the ladder instead of going to the player.
3.Although AI occasionally walks to the player in the above situations, it comes through the ladder.
How can I settle down these problems?
4

When baking the navigation,how to automatically make an obstacle dig out a “hole” that agents can’t walk on the sphere just like on the plane?
8
9

And how to only let the surface of the object participate in the navigation baking without its back?(That is, the agent can only walk on the surface, not on the back)

@11111 and @rey4033

A navmesh graph needs to be modelled completely in a 3D modelling application such as Blender or Maya. It’s not possible to cut out holes in it using e.g. a NavmeshCut component because those operations rely on the semi 2D nature of a normal navmesh or recast graph. Spherical worlds are significantly more complex.
You can take a look at this tutorial for more info: https://arongranberg.com/astar/docs/createnavmesh.html

In case of the stair, you should ensure there is a hole in the navmesh under the stair so that the character can only approach it from one direction (it makes no sense for the character to stand under the stair anyway since they would clip through the stairs surface if they are too close to the start of it.

Thank you very much! And is there any way to directly set the non walking holes at the obstacles in the prefabricated mode? :flushed:Such like this.

No, that must be done in a 3D modelling application (or possibly some plugin that does 3D modelling inside Unity).

Thank you for your reply. Now I want to confirm whether there is any way to solve these problems:
1.Whether the non walking area can be set in advance in prefabricated mode (Or Can I do this by NavmeshCut.cs)?
2.Can I set which ‘cutting hole’ can walk on by specific size enemy?
I may not have expressed these question very well so this picture maybe better to understand.

Hi

@rey4033. You cannot do this on a spherical world. That’s what I have been trying to tell you.
The navmesh cutting process relies on the world being mostly 2D (seen from above).

According to my current project requirements, if I do it in this way, I can’t imagine how much work is required. :face_with_thermometer: :face_with_thermometer: Is there any other relatively simple way to solve this problem?I don’t want my agent go through the obstacles to attack my player directly. :neutral_face:

I’m afraid that for spherical worlds there isn’t much that can be done.
I guess you can make a very high resolution sphere mesh and then use a regular GraphUpdateObject to make some nodes unwalkable. But it’s not a perfect solution.

What do you mean ‘GraphUpdateObject’?Is it a script in this plugin? :flushed: I just want to use this method,but why it is not a perfect solution? :flushed: Will you solve this question in sphercial world in the future? :face_with_thermometer: Maybe only you can do this. :flushed:

Hello,Aron,my idea now is:To get nodes within a certain radius,then set their own tag, and then set which tags the agent can’t walk on by Seeker.cs.But how can I get nodes in a range of a certain radius?(like Pyhcics.OverlapSphere).Can you give me a link of the tutorial?And Do you have any better way to solve this question now ? :joy_cat:

A GraphUpdateObject is pretty much like your idea. It’s how you update a graph in this package.
You can read more about it here: https://arongranberg.com/astar/docs/graph-updates.php and here https://arongranberg.com/astar/docs/graphupdateobject.html

Essentially you’d do something like

// As an example, use the bounding box from the attached collider
Bounds bounds = GetComponent<Collider>().bounds;
var guo = new GraphUpdateObject(bounds);

// Make all nodes inside the bounding box be unwalkable
guo, modifyWalkability = true;
guo.setWalkability = false;
AstarPath.active.UpdateGraphs(guo);