I’m having a problem with my path not getting calculated the way I want it to…
So I have this scenario, each climbing rope has a NodeLink2 which connects everything together.
I want the path to calculate so the player climbs upon the highest peak and then down on the other side but now the nearest node is at the bottom because, yeah it is I guess?
Here’s my seeker
Maybe “max nearest node distance” is too high?
That’s strange. Try to enable the ‘Areas’ debug visualization in A* Inspector -> Settings -> Graph Coloring Mode. That will tell you if the agent can actually reach the point you want it to reach (they should have the same color).
That’s correct, they have the same color.
The thing is that the scene starts out with an iceblock with a navmesh cut on it as this image shows. If this is enabled by default the player will move like the gif in my first post.
I want the player to go to the iceblock and stop there but he goes to the bottom as it’s the closest?
To make it even stranger, if I just disable the ice block the area below has no color at all and the player still walks to the bottom even though it now can be reached?
Here are the iceblock’s cut settings
The first image looks correct. The script will take the agent to the closest point it can reach. It’s impossible for it to know that you want it to go to the ice block instead.
The second image looks weird though. I’m not sure why it gets a grey color (different area) than the other stuff. Maybe the off mesh link will have connected to a different node when the region was occupied by a navmesh cut. You can try calling
nodeLink.Apply(true) after you have removed the navmesh cut (and let the graph update) to see if this is the issue.
No way to step through the calculate the path like a partial path or something?
For testing, I added
nodeLink.Apply(true) inside my link’s update method.
This is the result??
I get a complete area if I scan after disabling the iceblock (navmesh cut)