# Problem Spawning ANavMeshBoundsVolume in editor

**URL:** <https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [December 4, 2019, 9:17pm UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487 "2019-12-04T21:17:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a5e4dc30](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a5e4dc30](https://forums.unrealengine.com/u/anonymous_user_a5e4dc30)\
**Post date:** [December 4, 2019, 9:17pm UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487/1 "2019-12-04T21:17:02Z")

</div>

Hello, I am currently creating a plugin, where if I click on the button, it will spawn some static meshes as well as an ANavMeshBoundsVolume on an empty map.

Initially, I have tried something like

```auto

   ANavMeshBoundsVolume* BoundsVolume = World->SpawnActor<ANavMeshBoundsVolume>(
      ANavMeshBoundsVolume::StaticClass(), FTransform());

```

It does give me an ANavMeshBoundsVolume, But it was not functioning at all. I have noticed that the “Brush Settings/Brush Shape” in details is missing compared to when I drag a Nav Mesh Bounds Volume from the left panel.

 ![Annotation-20191204-131424.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/2/02b53057f4a849d362f62d8e21909b42664a4707.png)  
(The Icon looks different)

So I did some search online and tried adding:

```auto

   UCubeBuilder* CubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
   CubeBuilder->X = 200;
   CubeBuilder->Y = 200;
   CubeBuilder->Z = 200;
   CubeBuilder->Build(World, BoundsVolume);

   BoundsVolume->BrushBuilder = CubeBuilder;

```

Still, It does was not functioning at all.  
But a least this time it has the identical “Brush Settings/Brush Shape” in detail.

 ![Annotation-20191204-131513.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/3/9397e2794a807075cfd05ffb445b957c8b35b327.png)

And this thing shows up:

 ![Annotation-20191204-131307.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/0/b0901d17aa3598bdf44202ba7c38397b3643e911.png)

I have also tired SpawnActorDeferred, no effects at all. It seems like the problem is because of the volume actor’s collision component was wrong some how.

I am not sure what I can do with it. I have been stuck on this for two weeks already.

---

<div class="post-metadata">

**Author:** ![Not-Soup](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Not-Soup](https://forums.unrealengine.com/u/Not-Soup)\
**Post date:** [May 27, 2020, 5:36am UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487/2 "2020-05-27T05:36:44Z")

</div>

Are you still having trouble with this? If so I had some luck with the following:

```auto

FTransform NavMeshTransform = FTransform();
NavMeshTransform.SetScale3D(FVector(500, 500, 500));
NavMeshTransform.SetLocation(FVector(0, 0, 0));

ANavMeshBoundsVolume* BoundsVolume = GetWorld()->SpawnActor<ANavMeshBoundsVolume>(ANavMeshBoundsVolume::StaticClass(), NavMeshTransform);

UCubeBuilder* CubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
CubeBuilder->X = 200;
CubeBuilder->Y = 200;
CubeBuilder->Z = 200;
CubeBuilder->Build(World, BoundsVolume);
BoundsVolume->BrushBuilder = CubeBuilder;

```

\*\* Make sure “UnrealEd” and “NavigationSystem” are added to your Build.cs PublicDependencyModuleNames

---

<div class="post-metadata">

**Author:** ![B0dh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@B0dh](https://forums.unrealengine.com/u/B0dh)\
**Post date:** [September 27, 2020, 2:40am UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487/3 "2020-09-27T02:40:16Z")

</div>

> [@Not-Soup](#):
>
> Are you still having trouble with this? If so I had some luck with the following:
> 
> ```auto
> 
> FTransform NavMeshTransform = FTransform();
> NavMeshTransform.SetScale3D(FVector(500, 500, 500));
> NavMeshTransform.SetLocation(FVector(0, 0, 0));
> 
> ANavMeshBoundsVolume* BoundsVolume = GetWorld()->SpawnActor<ANavMeshBoundsVolume>(ANavMeshBoundsVolume::StaticClass(), NavMeshTransform);
> 
> UCubeBuilder* CubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
> CubeBuilder->X = 200;
> CubeBuilder->Y = 200;
> CubeBuilder->Z = 200;
> CubeBuilder->Build(World, BoundsVolume);
> BoundsVolume->BrushBuilder = CubeBuilder;
> 
> ```
> 
> \*\* Make sure “UnrealEd” and “NavigationSystem” are added to your Build.cs PublicDependencyModuleNames

i am tried it in 4.24 , but not work ☹  
is there any other setting i missed?

 ![_20200927103341.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/9/c9e9bc052e7b785897c0a8b955ca03351eccabc0.jpeg)

---

<div class="post-metadata">

**Author:** ![somaweb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@somaweb](https://forums.unrealengine.com/u/somaweb)\
**Post date:** [March 24, 2022, 1:50pm UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487/4 "2022-03-24T13:50:01Z")

</div>

Have you figured out how to do it?

---

<div class="post-metadata">

**Author:** ![CrabeMajestueux](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CrabeMajestueux](https://forums.unrealengine.com/u/CrabeMajestueux)\
**Post date:** [June 10, 2025, 2:14pm UTC](https://forums.unrealengine.com/t/problem-spawning-anavmeshboundsvolume-in-editor/134487/5 "2025-06-10T14:14:33Z")

</div>

If there are other people like me that try to generate NavMeshBoundsVolume via a script and not at runtime.  
I succeeded with the help of UActorFactory

```auto
#include "ActorFactories/ActorFactory.h"

ANavMeshBoundsVolume* BoundsVolume = EditorWorld->SpawnActor<ANavMeshBoundsVolume>(ANavMeshBoundsVolume::StaticClass(), NavMeshTransform);
  
UCubeBuilder* CubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
UActorFactory::CreateBrushForVolumeActor( BoundsVolume, CubeBuilder );

```

In UnrealEd module, so don’t forget to add it.
