Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to disable Nav Modifier Component

Hi All,

I've been able to successfully use NavAreas, QueryFilters and the Nav Modifier Component to be able to modify the navigation of certain agents.

This is achieved by several actors in the world having a Nav Modifier Component with a Nav Area set and then using a QueryFilter with the AI MoveTo.

But, sometimes I want these actors to not have this modifier. I want the ability to turn these modifiers on or off. I can see no way to do that. I've tried to set Navigation Relevancy to false but this doesn't seem to work. I'ce also tried exposing the AreaClass on the component to the blueprint and setting that to a different NavArea but that also doesn't work.

How is this achieved?


Product Version: UE 4.9
more ▼

asked Jan 08 '16 at 02:26 PM in Using UE4

avatar image

90 9 13 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

This required several changes. Thanks to vipeout for the help.

This setting needs to be set. Project Settings -> Navigation Mesh -> Runtime Generation -> Dynamic Modifiers Only

I was doing this in blueprint so in NavModifierComponent I also had to expose AreaClass as BlueprintReadWrite.

Then in the parent class NavRelevantComponent I had to expose RefreshNavigationModifiers as BlueprintCallable.

Then when I want to switch the Nav Modifier on the actor off I can set the AreaClass to either "none" or "default" and then call RefreshNavigationModifier. I've had word from Epic staff that this is OK to call.


more ▼

answered Jan 12 '16 at 09:16 AM

avatar image

90 9 13 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Set the 'Area Class' to 'NavArea_Null'.

Then, when you want it back on, set it to the class you used previously. You may wish to save that to some variable to restore previous state easily if there are more than 1 possibilities.

more ▼

answered Jan 08 '16 at 02:59 PM

avatar image

374 13 10 25

avatar image Hazeti Jan 08 '16 at 03:15 PM

Thanks for the response.

Forgive me but if you set it to NavArea_Null then shouldn't that mean the area can't be traversed at all? Did you mean set the Area Class to "None"? That is what I thought should do the trick, but it doesn't seem to have any effect. When setting the NavArea to "none" or "Nav Area Default" the agent is still avoiding the area.

avatar image vipeout Jan 08 '16 at 04:12 PM

I wrote a longer comment but it got lost after clicking post... Ehh...

Yes it's None and not Null (why is this different I don't know).

That's not the whole story though. If you wanna change it run-time, you need to tell it to the project. By default all paths are static, which means that once editor calculates them, they never change.

Project Settings -> Navigation Mesh -> Runtime Generation. Go with Dynamic Modifiers Only (thats what you're asking for, unless you want moving objects with collision to update paths as well).

It will register the change up to tick interval later (default 0.5) then recalc the navmesh on the affected node(s). The bigger and more complex the node the tougher the calculation so choose your recast parameters well and do not overuse that feature (if you care for performance that is).

avatar image Hazeti Jan 08 '16 at 05:11 PM

Ahhh! Thank you for that titbit of information. That was part of what I was missing. I had not set runtime generation to Dynamic Modifiers Only.

Although, that wasn't the complete solution. It still wasn't updating. I had to expose and manually call RefreshNavigationModifiers myself. Not sure if that's the wisest thing to do as that means it is doing it then and there and not when the system decides to do it.

It is at these times I wish UE4 had more documentation of it's features.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question