How to disable Nav Modifier Component
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?
asked Jan 08 '16 at 02:26 PM in Using UE4
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.
answered Jan 12 '16 at 09:16 AM
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here