Niagara Scratch Pad - get camera position

Hi,
Any idea how I can get my camera position in Scratch Pad to make a custom CameraOffset?

I’m trying to modify the Camera Offset so it works when the camera comes closer to the emitter than the sett value of the CameraOffset
Let’s say my CameraOffset is set to 100, but my camera comes closer than 100 units it will clip my particle. So I want to set the CameraOffset to 100 but if the vector between my camera and emitter is smaller than 100, it becomes that smaller value.
To do this I need to be able to get my camera position and simulation position and compare it to the current CameraOffset and change it when it becomes smaller.
So how do you get the camera position in scratch pad?.. and basically make a custom CameraOffset

What you’re looking for is a Data Interface input called Camera Query. You can create a Niagara System level user parameter called CameraQuery, it will grab the camera of the player index you choose. Then use this parameter as a module input in your scratch pad. From there you can pin off the camera query and create a Get Camera Properties node which works for both CPU and GPU.

9 Likes