0
\$\begingroup\$

I have a scene in my game that takes place in a subway. I created a NavMesh so I can easily have the enemies chase the player. There seems to be a problem though as them enemies sometimes have a problem crossing the track. When looking at the NavMesh it appears that some parts of the track stick out above the NavMesh and I believe this is the reason the enemies sometimes have problems crossing the track. I have tried changing the step height up and down but that doesn't seem to change anything. What can I do to make the NavMesh cover the track in all spots so enemies can cross the track anywhere? Or is there maybe something else causing the enemies to not be able to cross the track in some spots?

EDIT

The rails and the ground are the same object and it is set as Navigation Static. Do they need to be 2 different objects for this to work?

enter image description here enter image description here

\$\endgroup\$
1
\$\begingroup\$

The Step Height setting is not affecting your enemies' pathing because the objects in question are not part of their navmesh, so they don't even recognize them as something they could path over.

You should be able to select the rails and mark them Navigation Static prior to baking your navmesh to include them in the baking process. Then you can step over them using Step Height.


Alternatively you could add Navigation Obstacle components to the rail, and your AI would attempt to walk around them. This likely isn't going to be the behavior you want though.

\$\endgroup\$
  • \$\begingroup\$ They are set as Navigation Static already. \$\endgroup\$ – Jason Crosby Apr 22 '16 at 15:56
  • \$\begingroup\$ Oh I see. I should have guessed actually based upon the inconsistency in the navmesh; is the height of the rails irregular? What about the roof in this scene? If either of these are variable you could actually be looking at a problem with the Agent Height setting (agents see the roof as too low to get past those specific parts). \$\endgroup\$ – GorkTi200 Apr 22 '16 at 16:14
  • \$\begingroup\$ Not entirely sure if all the rail is the same height I purchased it from the asset store. I'll play around with agent height and step height to see if I can get it working right. \$\endgroup\$ – Jason Crosby Apr 22 '16 at 18:01
  • \$\begingroup\$ I lowered the agent height and step height and it seems to be working much better now. Thanks for the help. \$\endgroup\$ – Jason Crosby Apr 22 '16 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.