WARNING : This site is outdated and the PopcornFX team will no longer answer your questions here.
For all support questions please go to our Discord server
0 like 0 dislike
The only way I have managed to do this is using a shape sampler and .kill()

I only need to kill particles that get within a constant distance of the camera so this seems like a poor solution.
by metalayer (410 points)

1 Answer

2 like 0 dislike
Best answer
Hi ! Which version of popcorn are you using ?
Using V2 :
You can access the position of the camera inside PopcornFX graph. We also have a template that takes a particle position as input and returns its distance to the camera. Here is how I used it to kill particles within a range of 1 unit (view.distance computations must be set to "evolve"):


You might also want to disable particle render without killing it. You can use the "Enabled" pin for that purpose:


Let me know if you're using V1.
by paulhub (980 points)
Hi, sorry we are on version 1.13
Using V1, you should be able to use the view.distance() function in an evolver script. Here's how I did it :

function void    Eval()
    int isInRange = view.distance(Position) < 1.0f;