Download

Create and configure new Niagara Emitters from C++

Hello, new Unreal developer here!

I’m trying to create a magic system that lets the player add spells and modifiers to a spell stack and combine them following a set of rules, creating new spells in the process (that maybe can be combined even further)

To do that with Niagara I need to be able to create new emitters from C++ using the merged settings of both emitters, then load the new emitter into a UNiagaraSystem.
I’m guessing that I have to follow this path since I want to be able to merge multiple effects together and not just chain them (maybe one spell has a vortex modifier and the other burst meshes in an area, so the child could burst them in an area and the direction is altered by the parent vortex)

The compilation times for the UNiagaraSystem are more than fast enough to compile them on runtime (at least in my machine with test systems) so it doesn’t worry me a lot, and I see functions to ask the system to recompile from C++.

My main concern is being able to deduct the current properties and create a new UNiagaraScript to populate the different FNiagaraEmitterScriptProperties so I can create a new emitter into the new derived system (I’m guessing).

Is this even possible with current versions?
The editor does it (although with scratchpad…), do I have to fondle with UnrealEditor code?
Maybe using an empty system and adding lots of simulation stages?
Are the provided modules even accessible from code?

As I am unable to find ANY working example creating emitters from c++, can you please post an example if you now how to?

I’m working with UE5 early access 2

Thanks a lot in advance to everyone!

Let me bump this in case anyone knows anything

Thanks!