How To Fix/Snap/Constrain Niagara System Particles To Exact Screen/Camera Location(s)

I am trying to create a basic Niagara system, which spawns particles as though the particles were attached directly to the screen–each particle spawning to and dying from the same location(s) relative to the screen/camera. Please see the attach video. The beginning of the video shows exactly what I’m looking for–particles spawning and dying around the edges of the screen. However, once the camera moves, the particles stay at their origin (which I don’t want). Similarly, the particles only spawn in front of the camera due to a crude offset (see blueprint), which only works when the camera points in that one world direction (which I don’t want). So;

  1. Spawning around edges of camera, which I’ve achieved with a torus shape
  2. Once an individual particle spawns, it transforms to maintain zero offset with the camera (follows the camera)
  3. Dynamically spawning with an attachment to the screen, regardless of the camera transform

Any help would be greatly appreciated. Including whether or not Niagara can even do this.

What is your question? If you want to keep particles attached to camera, I see that you spawn it already attached, but see if your emitter has “Local Space” enabled? If no, then the particles will stay in world location where it spawned

Hi @fn75372,

To echo @FAXCORP, yes, the solution will be to attach the niagara system to your camera component and change your system to local space (you can just click on the entire emitter and it will be the first option. It’s hard to tell if you’re doing this in the screenshot, but make sure when you attach and offset, you also control the rotation so the system is always facing the camera along the X and Y axises (it looks like you might already be doing this anyways). This will make things a lot easier in the future and avoid you having to mess with matrices.

However, this problem may be more complex than you realize, as you will have to account for different monitor sizes if you always want them to appear on the edges of the camera. To get the particle bounds, grab the viewport size from your blueprint, then input it as a new Niagara User Parameter. When you set your plane/box size, you can input your user parameter.

If you are offsetting from the camera, you’ll need to add a multiplier, and you can continue to use this Vector 2D for masking the inside of your effect and such.

Another side note- if your effect needs to have some depth to it, I would recommend faking this through particle size. If for some reason you can’t use this method, be aware that your particles further away will not take up the entire viewport due to the 2D to 3D conversion of a box. You can get around this by using Slabs as your shape type, though this gets a little more complicated so let me know if that’s something you need and we can go into it then.

Thank you @FAXCORP and @sarahlenker for the responses; both lead me to the result I was looking for. I’m new to UE and always pleased at how easily things can be done, with the knowledge. For now, I’ll just go with what I’ve got, but I’ll make a note concerning resolutions and monitors for the future. My must needs backup is a widget with circles that scale from zero to some value to make them appear to come and go.

For anyone, who finds themselves here in the future:
I added a scene component to act as a permanent offset to the camera “lens” and used that location/rotation for the Niagara spawner. And, as mentioned, checked the Local Space option within the Niagara emitter.

Thanks again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.