# Is it possible to change if a mesh affects nav mesh during run time

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint\
**Created:** [February 18, 2016, 4:48pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888 "2016-02-18T16:48:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![WARRIORPIN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WARRIORPIN](https://forums.unrealengine.com/u/WARRIORPIN)\
**Post date:** [February 18, 2016, 4:48pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/1 "2016-02-18T16:48:22Z")

</div>

Hello

I have been having a problem trying to stop an object affecting the nav mesh while the game is running. I basically have a destructible mesh and want it to stop affecting the nav mesh once fractured, so that my AI can walk over the remains. It seems you can not change the bool for “Can ever affect navigation” through blueprint (None that I have found anyhow).  
I would just like to know if it is possible to stop it affecting the nav mesh while in run time and how to do this?

Thank you in advance for any help and replies to this post.

---

<div class="post-metadata">

**Author:** ![Noowai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Noowai](https://forums.unrealengine.com/u/Noowai)\
**Post date:** [June 2, 2017, 1:49pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/2 "2017-06-02T13:49:29Z")

</div>

Hello, warriorpin! I’ve stuck with same thing, have you figured it out?

---

<div class="post-metadata">

**Author:** ![YuchenMei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yuchenmei/32/918680_2.png) [@YuchenMei](https://forums.unrealengine.com/u/YuchenMei)\
**Post date:** [October 2, 2017, 1:59pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/3 "2017-10-02T13:59:44Z")

</div>

Hi,

I found a way to change this bool at runtime. If you go ActorComponent.h, there is a method called SetCanEverAffectNavigation, just put a UFUNCTION(BlueprintCallable, Category=“Collision”) (This category allows you to find this method in blueprint collision category) on top of it to make it a UFUNCTION which can be called from blueprint. Recompile your engine after this change and it should work.

Cheers,

Yuchen

---

<div class="post-metadata">

**Author:** ![bennetherwood](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bennetherwood](https://forums.unrealengine.com/u/bennetherwood)\
**Post date:** [November 2, 2017, 5:29pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/4 "2017-11-02T17:29:34Z")

</div>

YuchenMei,  
sorry I know this is a while ago, but could you guide me how to do this. Im quite new at C++ in UE4. I tried adding the code above in the line above SetCanEverAffectNavigation and rebuilding both the game and the engine but this didnt help anything.

Cheers,  
Ben.

---

<div class="post-metadata">

**Author:** ![YuchenMei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yuchenmei/32/918680_2.png) [@YuchenMei](https://forums.unrealengine.com/u/YuchenMei)\
**Post date:** [November 3, 2017, 8:12am UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/5 "2017-11-03T08:12:04Z")

</div>

Ok, so in your blueprint, you should be able to call the function SetCanEverAffectNavigation and the target is the static mesh you want to change whether it affects the navigation. If you set the tCanEverAffectNavigation to false of the static mesh, it should stop this static mesh from affecting the navmesh.

Let me know if I am not explaining it well and it would be better to describe what you want to do more.

Cheers, Yuchen

---

<div class="post-metadata">

**Author:** ![bennetherwood](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bennetherwood](https://forums.unrealengine.com/u/bennetherwood)\
**Post date:** [November 4, 2017, 9:59am UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/6 "2017-11-04T09:59:34Z")

</div>

Hi Yuchen,  
Sorry i dont think i was clear. I want to be able to expose and call’SetCanEverAffectNavigation’ on static meshes spawned at runtime (which is currently not exposed in BP). These do not have this option at present, so how do you modify the C++ code in actorcomponent.h, because ive tried and it didnt seem to work (reading your post I assume you know how).

Cheers,  
Ben.

---

<div class="post-metadata">

**Author:** ![KindredGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KindredGames](https://forums.unrealengine.com/u/KindredGames)\
**Post date:** [November 8, 2017, 11:16pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/7 "2017-11-08T23:16:44Z")

</div>

EDIT: Okay, I found where to add the UFUNCTION line at and I’ve compiled just fine, but this still doesn’t show up in Blueprints. Can’t search, nor find it in the collisions section.

Any other steps we’re missing?

---

<div class="post-metadata">

**Author:** ![Vaheva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vaheva/32/963466_2.png) [@Vaheva](https://forums.unrealengine.com/u/Vaheva)\
**Post date:** [November 8, 2017, 11:32pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/8 "2017-11-08T23:32:16Z")

</div>

For Pawn, you can use function **Set Can Affect Navigation**. You should disable _Context Sensitive_ in _All Actions For Blueprint_ to find it.

For non Pawn actors, you can create **NavLink** and dynamically switch it.

Simplest method is to create **Nav Modifier Volume** with _null_ and destroy it when destructible will be destroyed. I’m using mixed solutions depending on situation.

Well, this all is not need if you have **dynamic** Nav Mesh update on of course 🙂

---

<div class="post-metadata">

**Author:** ![KindredGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KindredGames](https://forums.unrealengine.com/u/KindredGames)\
**Post date:** [November 9, 2017, 1:54am UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/9 "2017-11-09T01:54:46Z")

</div>

Thank you for all the alternate solutions. I found one that would work for my game using a modifier volume. Much simpler than the original solution proposed.

---

<div class="post-metadata">

**Author:** ![Tbjbu1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tbjbu1](https://forums.unrealengine.com/u/Tbjbu1)\
**Post date:** [October 20, 2022, 6:32pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/10 "2022-10-20T18:32:05Z")

</div>

Thanks, btw those quotes give an error. Use regular quotes.  
UFUNCTION(BlueprintCallable, Category = “Collision”)

---

<div class="post-metadata">

**Author:** ![eryteusz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eryteusz](https://forums.unrealengine.com/u/eryteusz)\
**Post date:** [June 8, 2023, 3:11pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/11 "2023-06-08T15:11:16Z")

</div>

I struggled with the same problem but found a nice workaround. You cannot change whether it affects navigation at runtime, BUT you can set “Can Ever Affect Navigation” to true, and then use “Set Collision Response to Chnnel” for Pawn and Vehicle collision channels to ignore/block depending on if you want to rebuild the navigation or not. If you set them to block then NavMesh’ll dynamically rebuild the navigation, if you set them to ignore the NavMesh somehow won’t detect them and won’t rebuild the navigation. Hope it helps.

---

<div class="post-metadata">

**Author:** ![GrigLog](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrigLog](https://forums.unrealengine.com/u/GrigLog)\
**Post date:** [February 26, 2026, 7:11am UTC](https://forums.unrealengine.com/t/is-it-possible-to-change-if-a-mesh-affects-nav-mesh-during-run-time/347888/12 "2026-02-26T07:11:33Z")

</div>

I think I found the intended approach to achieve the desired behaviour.

First, go to Project Settings → Navigation Mesh → Runtime and set `Runtime Generation` = `Dynamic Modifiers Only`. You can’t keep it at the default value of `Static`, but `Dynamic` is worse for performance and is not required in the use case of enabling/disabling collision on an otherwise static object.

As far as I am aware, there are two ways to create such dynamic modifiers - by using a `Nav Modifier` component or by using a Shape Component with a flag `Dynamic Obstacle` = true. We are going to use the second way because dynamic obstacles both provide colliders and modify NavMesh at runtime when their collision settings change. Meanwhile `Nav Modifier` component has no collision and it expects its parent actor to have collision from some other components. It’s just more bothersome to work with.

So, go to your actor and untick `Can Ever Affect Navigation` from all components that have it, because they are not dynamic modifiers. You might as well just disable all collisions to keep things cleaner. Instead, add a `Box Collision`, `Sphere Collision` or `Capsule Collision` component (any subclass of UShapeComponent is fine), configure its size and collision in a way that suits your purpose, and then tick `Can Ever Affect Navigation` = true and `Dynamic Obstacle` = true.

If you did everything right you will now see the area around your actor highlighted in orange in the editor with Navigation visualization enabled. From now on, just calling a `Set Collision Enabled` blueprint node in runtime is enough to enable or disable this orange area of NavMesh.
