# Spawn Niagara particle?

**URL:** <https://forums.unrealengine.com/t/spawn-niagara-particle/132051>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [October 10, 2019, 5:23pm UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051 "2019-10-10T17:23:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juice-Tin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juice-tin/32/1008648_2.png) [@Juice-Tin](https://forums.unrealengine.com/u/Juice-Tin)\
**Post date:** [October 10, 2019, 5:23pm UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/1 "2019-10-10T17:23:48Z")

</div>

Simple question, what is the Niagara equivalent of this?

```auto

UGameplayStatics::SpawnEmitterAtLocation(world, particle, transform);

```

Just trying to spawn 1-time effects (like explosions) in the world without having a component. Can’t find any way to spawn niagara emitters.

---

<div class="post-metadata">

**Author:** ![ExtraLifeMatt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extralifematt/32/918695_2.png) [@ExtraLifeMatt](https://forums.unrealengine.com/u/ExtraLifeMatt)\
**Post date:** [October 10, 2019, 5:44pm UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/2 "2019-10-10T17:44:22Z")

</div>

```auto

UNiagaraFunctionLibrary::SpawnSystemAtLocation(...)

```

---

<div class="post-metadata">

**Author:** ![Juice-Tin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juice-tin/32/1008648_2.png) [@Juice-Tin](https://forums.unrealengine.com/u/Juice-Tin)\
**Post date:** [October 10, 2019, 6:20pm UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/3 "2019-10-10T18:20:31Z")

</div>

Thankyou 🙂

---

<div class="post-metadata">

**Author:** ![axelZellalex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@axelZellalex](https://forums.unrealengine.com/u/axelZellalex)\
**Post date:** [October 20, 2020, 9:49pm UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/4 "2020-10-20T21:49:30Z")

</div>

> [@ExtraLifeMatt](#):
>
> ```auto
> 
> UNiagaraFunctionLibrary::SpawnSystemAtLocation(...)
> 
> ```

Hey how does this work?

#include “NiagaraFunctionLibrary.h”

gives me the error:  
Cannot open include file: ‘NiagaraFunctionLibrary.h’: No such file or directory

I tried adding:  
#include “Niagara/NiagaraFunctionLibrary.h”  
#include “Plugins/Niagara/NiagaraFunctionLibrary.h”

Same error. I’m not sure what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![nullterm](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nullterm/32/88718_2.png) [@nullterm](https://forums.unrealengine.com/u/nullterm)\
**Post date:** [October 21, 2020, 2:36am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/5 "2020-10-21T02:36:11Z")

</div>

> [@axelZellalex](#):
>
> Hey how does this work?
> 
> #include “NiagaraFunctionLibrary.h”
> 
> gives me the error:  
> Cannot open include file: ‘NiagaraFunctionLibrary.h’: No such file or directory
> 
> I tried adding:  
> #include “Niagara/NiagaraFunctionLibrary.h”  
> #include “Plugins/Niagara/NiagaraFunctionLibrary.h”
> 
> Same error. I’m not sure what I’m doing wrong?

Do you have the plugins turned on?

---

<div class="post-metadata">

**Author:** ![axelZellalex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@axelZellalex](https://forums.unrealengine.com/u/axelZellalex)\
**Post date:** [October 21, 2020, 8:04am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/6 "2020-10-21T08:04:45Z")

</div>

Yeah they’re turned on, and I can access in the content assest window.  
Do i need to change something in my VS project?

---

<div class="post-metadata">

**Author:** ![nullterm](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nullterm/32/88718_2.png) [@nullterm](https://forums.unrealengine.com/u/nullterm)\
**Post date:** [October 21, 2020, 8:24am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/7 "2020-10-21T08:24:01Z")

</div>

Oh, did you add it to your .uproject?

{  
“FileVersion”: 3,  
“EngineAssociation”: “4.25”,  
“Category”: “”,  
“Description”: “”,  
“Modules”:  
{  
“Name”: “MaulProto”,  
“Type”: “Runtime”,  
“LoadingPhase”: “Default”,  
“AdditionalDependencies”:  
“Core”,  
“Engine”,  
“ProceduralMeshComponent”,  
“RenderCore”,  
“RHI”,  
“PhysicsCore”,  
“Text3D”,  
**"Niagara"**  
]  
}  
],

---

<div class="post-metadata">

**Author:** ![axelZellalex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@axelZellalex](https://forums.unrealengine.com/u/axelZellalex)\
**Post date:** [October 24, 2020, 10:10am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/8 "2020-10-24T10:10:06Z")

</div>

> [@nullterm](#):
>
> Oh, did you add it to your .uproject?
> 
> {  
> “FileVersion”: 3,  
> “EngineAssociation”: “4.25”,  
> “Category”: “”,  
> “Description”: “”,  
> “Modules”:  
> {  
> “Name”: “MaulProto”,  
> “Type”: “Runtime”,  
> “LoadingPhase”: “Default”,  
> “AdditionalDependencies”:  
> “Core”,  
> “Engine”,  
> “ProceduralMeshComponent”,  
> “RenderCore”,  
> “RHI”,  
> “PhysicsCore”,  
> “Text3D”,  
> **“Niagara”**  
> ]  
> }  
> ],

AH! I didnt… I dont remember seeing this ANYWHERE in the docs lol  
I googled and click through so many Unreal “welcome to niagara” stuff - but they all seemed BP related ☹  
Is there a bit I’m missing to see an example of a c++ version of this?

Is it normal, that my AdditionalDependencies only has “Engine” ? I see youve got Core, for example…

Also, how do I know when I need to add to this array?  
Is this separate (or does it allow for more) #include xyz?  
Is there an obvious part of the docs I can keep an eye out for?

Sorry last question.  
VS compiles fine now.  
But my “#include “NiagaraFunctionLibrary.h”” has a red squiggle under it with “cannot open source file”.  
And when i write the codes:

```auto

UNiagaraFunctionLibrary::SpawnSystemAtLocation();

```

Red squiggle under “UNiagaraFunctionLibrary” and saying “name followed by ‘::’ must be a class or namespace name”

I assume these are related, and not actually an issue, just my VScode being funky?

Cheers!

---

<div class="post-metadata">

**Author:** ![nullterm](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nullterm/32/88718_2.png) [@nullterm](https://forums.unrealengine.com/u/nullterm)\
**Post date:** [October 25, 2020, 2:30am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/9 "2020-10-25T02:30:42Z")

</div>

Anytime you are adding a new module or system to your, you’ll need to make sure it’s in there. But usually not very often.

I don’t really know any documentation, it was just something I figured out reading other people’s posts asking about linker errors. I think I was trying to get ProceduralMeshComponent working.

As long as it compiles, you’re fine. The red squiggles just mean that VSCode can’t find the header, but the actual compiler can just fine. If you use the Unreal command to regenerate the project files, it might go away after Unreal includes the appropriate header paths in the project.

---

<div class="post-metadata">

**Author:** ![Auticus.Daerk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/auticus.daerk/32/553980_2.png) [@Auticus.Daerk](https://forums.unrealengine.com/u/Auticus.Daerk)\
**Post date:** [March 19, 2023, 5:16am UTC](https://forums.unrealengine.com/t/spawn-niagara-particle/132051/10 "2023-03-19T05:16:56Z")

</div>

Man that is so evil. That you have to know to do that… thats… wow.
