ProjectPointToNavigation issues

I’m using dynamic navmesh generation with a character that can pick up and move boxes. The box actor has “Can Ever Affect Navigation” turned on… so that characters don’t try to walk through them.

Right after placing a box (which modifies the navmesh) the character position sometimes projects to a point no longer on the navmesh. Then calling ProjectPointToNavigation it often picks a position on the sliver of navmesh on top of the box. This is not desirable because attempts to call things like NavSys->GetPathLength() from this point fail.

One way I’d like to try to solve this would be to prevent navmesh (islands) from being generated on top of the box. The only property I could find “Can Character Step Up On” set to No, has no affect. Is there any way to designate an object as a navigation blocker but not to generate navmesh on top of its surfaces?

Alternately if ProjectPointToNavigation() had a flag to only consider static geometry or something that might be helpful.

Do you have any other suggestions on how to solve this problem?


There is no easy way, but you can add navmesh modifier to box actors set to mark navmesh with NavArea_Null. Position and bounds of modifier need to cover area around box’s top. You can’t use existing UNavModifierComponent class though, because it marks navmesh below actor.

Either create your own component class derived from UNavRelevantComponent or export navigation modifiers directly by box actor (check INavRelevantInterface for details, required functions: GetNavigationData, GetNavigationBounds).