Jump to content

Nav Mesh Targeting


randomkeyhits
 Share

Recommended Posts

Ok, having done some testing I'm noticing a sort of strange behaviour with a test map I've created.

 

Flat plane, a wedge, and a large box. The top of the wedge is connected to the box by an arch.

 

I've created the nav mesh which looks exactly as I'd expect and allows navigation from the plane via the wedge and arch onto the box.

 

I've set up my cam and player scripts for an isometric style view and I can click on the nav mesh and watch the player move to the specified location. All well and good.

 

When the cursor is outside of the geometry it is a 2d cross hair suitable for clicking on any hud elements. When it is over the game geometry I make it a small globe. I then test to see if the globe location can be navigated to and if it is the globe is green else its red. Its a useful indicator of what is happening in the scene.

 

The strange behaviour is that some sides of the box get marked as navigable when I would expect them to not be as they are vertical and have no mesh. If I click to say "go here" the player entity will try but not be able to reach final spot and be permanently in travel mode until I set a new target location.

 

So... can anyone explain why only some walls should be navigable? I've not found anything that makes sense yet.

content over form, game play over all.

Link to comment
Share on other sites

@Aggror

 

I get where you are coming from on that and went through and re-generated the nav-mesh, sadly no difference.

 

@Rick

 

GoToPoint() does care about the nav-mesh, the documentation says it uses the navigation system which I take to mean nav-meshes.

 

The method I use is to create a pivot and then place it where I want it to travel to. I then tell it to go to that same location, get the return from the function and then tell it to stop regardless. If the location is on the nav-mesh then it returns true as navigable and if not it returns false.

 

If I create a map where I can toggle parts of it as being navigable then for the flattish surfaces the behaviour is exactly as you'd expect. What is frustrating is that the walls thing isn't even consistent. Some walls behave as expected, some don't.

content over form, game play over all.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...