Thanks!I will have a try!
GraphUpdateObjects set to modify the tag cannot create new nodes. They will only update existing nodes. It will update all nodes which have a center that lies inside of the bounding box and the shape of the graph update object.
In your case no triangle centers seem to overlap that bounding box.
Hello Aron.In addition to setting âASTAR_ RECAST_ LARGE_ Tilesâ is true, Is there any way to solve this error? I dont want the vertex count be limited.
I have used the âGraphUpdateObjectsâ method to solve the obstacle question,but it doesnt work,which step did I do wrong?
This is a trade-off between tile count and vertex count in a single tile. In your case you definitely should enable that since for a spherical graph you only have a single tile.
Ah, Unity has Updated their build groups again:( . This shouldnât cause any problem, but itâs a bit annoying in the UI. I have to hard-code the build groups every time Unity update them which is pretty annoying.
I donât have any problem updating a navmesh graph either with tags or making the nodes unwalkable.
Here is a screenshot of the setup I used:
Note that you can debug the tag values by setting A* Inspector -> Settings -> Graph Coloring to Tags.
You may have to set guo.updatePhysics = false.
OK,I will try it ,thank you very much
What I want to modify is just as small as the red box, but in fact, itâs larger than I thought. What I can think of is to do more vertex points, but it will have the limit of âToo many vertex in the tileâ. Can you give me some suggestions?
Can you not apply âASTAR_RECAST_LARGE_Tilesâ?
If it doesnât work due to the error you can add it manually by editing the Player settings. Add it to the list of âAdditional Definesâ in the player settings.
Yes,I just want to make âASTAR_RECAST_LARGE_Tilesâ false so that I can use the mesh whose vertices more than 4095.But where is the âAdditional Defines â,I cant see it in PlayerSettings.
You need to scroll down.
Itâs called Scripting Define Symbols these days apparently.
Thank you.Can I specify that some âGraphupdateobjectsâ only work on a certain layer, for example,âGraphupdateobjectsâ of radius 0.5 only works on Navmeshgraph1, andâ Graphupdateobjectsâ of radius 1 only works on Navmeshgraph2?
I use âAstarPath.active.UpdateGraphs(guo)â,but it seems to be modify all graphs those in the A* PathFinder inspector
You can use
// Only update graph index 0
guo.nnConstraint.graphMask = 1 << 0;
// Only update graph index 1
guo.nnConstraint.graphMask = 1 << 1;
Ah,now Iâm beginning to believe that I can solve the problems Iâve encountered!
Thanks!
Hi,Aron, at present I have used the âGraphUpdateObjectsâ to âbakeâ a obstacle on sphericial world(as long as each triangle is small enough,itâs enough for me) And now I want to use this method to realize âdynamic obstacleâ,for example,this time my player will take down a box on ground and its âGraphUpdateObjectsâ collider will overwrite âguo.setWalkbility=falseâ, then next time my player move the box to a far position its âguo.setWalkbility=trueâ, it is better to achieve the function like sliding door.Here is my code,but I dont think this is a good idea,because when I update the graph in runtime the frames will drop by several seconds(And is there any way to increase the speed of âUpdateGraphsâ? )Or is there any âasnycâ method to âUpdateGraphs(guo)â ,then when updating graphs the game will not be stuck ?
Hi,Aron,for solving the frames dropping when UpdateGraphs(guo),I have tried to put this method into a thread,but it will come an exception "UnityException: get_isPlaying can only be called from the main thread.Constructors and field initializers will be executed from the loading thread when loading a scene.
Donât use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. " So I want to ask you does A* pro have an async method for âUpdateGraphsâ?
Hi
It looks like you are updating every single collider every time you need to update the graphs. Is this really necessary?
The navmesh graph cannot be updated asynchronously Iâm afraid. You can spread the update out over several frames by only scheduling a few graph updates per frame (and using FlushWorkItems every frame). However this will also prevent pathfinding from running a large portion of the time.