x

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"

Is it possible to enable Nav Modifiers on dynamically spawned blueprint actors?

Hi, I have a blueprint which has a Box collision component and a Nav Modifier component. The Nav Modifier area class has been set to NavArea_Obstacle. When I add an actor of this blueprint into the level from the editor, it works fine and the AI bots avoid moving through this actor unless the alternatives are too long.

But when this actor is spawned in at runtime using blueprints, the AI completely ignores it. I've confirmed it's placement by turning on the collision visibility and navigation display, and it clearly has no effect on the nav mesh unlike the one that's placed in the editor manually. Enabling runtime nav mesh generation doesn't seem to have any effect either. So is there something that I'm missing here? Or does the engine have no support for adding Nav Modifiers using blueprint at runtime?

Product Version: UE 4.10
Tags:
more ▼

asked Nov 24 '15 at 10:19 AM in Blueprint Scripting

avatar image

Stormrage256
967 82 75 117

avatar image hvs_jbg Feb 23 '16 at 01:13 AM

I have a similar issue. However, my issue seems sensitive to the spawn location of the obstacle with respect to the player controller.

The object is a Blueprint class with a Collision Capsule component attached to it (flagged as a Dynamic Obstacle, AreaClass = NavArea_Obstacle). When spawned at the location of the player controller's current pawn, I see a patch of Navmesh turn red briefly as it updates. When complete, a red hole is present in the navmesh where the obstacle is positioned. But, when I spawn the same obstacle at an arbitrary location on the navmesh, no hole is left after the navmesh is updated.

My Navmesh settings are set to Dynamic, and to Force Rebuild on Load.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Finally figured it out. For a collision box to act as a nav modifier, it seems that we have to turn on the 'Dynamic Obstacle' parameter under it's Navigation properties. Now it's working fine. :D

alt text

navmod.png (232.1 kB)
more ▼

answered Dec 16 '15 at 05:49 PM

avatar image

Stormrage256
967 82 75 117

avatar image BorinG10 Apr 02 '18 at 12:01 PM

thanks! exactly what i needed so characters dont spawn in meshes

(comments are locked)
10|2000 characters needed characters left

Hi Stormrage,

I had a similar problem getting the navmesh to rebuild at runtime. Ticking Force Rebuild on Load in the project navigation mesh settings fixed it for me.

alt text

more ▼

answered Nov 24 '15 at 07:15 PM

avatar image

Alderbit
866 36 14 59

avatar image Stormrage256 Nov 25 '15 at 03:16 AM

Hi Alderbit, the nav mesh rebuild part is working fine for me. By placing normal meshes on the level at runtime, the enemy AI changes path accordingly. The issue that I'm facing right now is that the nav modifiers don't update the nav mesh when spawned in at run time. I had expected that changes in nav mesh area costs would also be taken into account while the nav mesh rebuilds itself.

(comments are locked)
10|2000 characters needed characters left
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