Activating Niagara Component at runtime?

I have a Niagara System that I want rendered at a certain fixed relative location to an actor.

I’ve added a Niagara Component in the component hierarchy of the Actor. When the actor spawns the Niagara System activates and displays showing particles at the correct location in its local space relative to the actor.

But I want to change it such that the niagara system displays on a certain event (possibly multiple times during the actors lifetime), rather than at actor spawn.

What is the best way to do this? Should I create and add the component dynamically at runtime to the actor each time I want to display it? Or is there some way to show/hide/activate a persistent niagara component?

I’ve heard of “child actors” (but I don’t really know what they are), possibly an alternative would be to spawn a child actor component or something ?

Any ideas?

Hi @zos!

A few questions. Is the actor you are attaching the niagara system to some sort of npc/player? If so, does the niagara effect also trigger at the same time as an animation? If you follow the Niagara quick start guide [ Niagara Quick Start ], the guide shows you how to activate a niagara effect when a specific animation is played.

If not, what are you trying to achieve specifically? Are you creating an environmental effect that happens around the actor? Does the actor have the effect protrude from or emit near when certain conditions are met? Is this a random interval kind of effect you are looking for?

Any information helps an I am sure this will be figured out!

The Actor is actually the players pawn, and the niagara component is attached as a child of the camera component (with a +X local transform) so that it will render in front of the camera. It is a little celebration of a level up event (some fireworks and a rotating/flashing 3d text mesh), and not associated with any animation.

What I’ve discovered is that you can Activate and Deactivate a niagara component (there are blueprint nodes called Activate and Deactivate), so what I’ve done at the moment is turn off Auto-Activate on the niagara component, and then when the event occurs I call Activate and then Deactivate 2 seconds later. It appears to work, but I’m not sure I understand what “activation” means, or if this is its intended use.