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
I can't find any good example how to use attractor template in popcorn fx nodegraph.

I want to spawn particles in mesh volume and make it move toward different position.

Please help !
by niceyaeja (170 points)

1 Answer

1 like 0 dislike


We don't have an example of that right now, we are in the process of creating video tutorials, writing online documentation for PopcornFX v2 so that's definitely something we want to cover also (attractors).

Right now, the setup is a bit tedious, but here's how to have something working:

The Attractor template needs to be placed before the Physics node, and output Force needs to be plugged into the Physic's Accel input. The Physics node needs an input velocity so it can properly work, here I put the spawn shape's normal.

Attractor takes the attract shape as input (here, the sphere in the top right corner), and needs the particle position (during update, so it can output a different force at every evaluation).

The during update part is why you need to place a "discretization point" shared with the physics node, what this does is the Attractor template gets the particle position computed by the Physics node the previous frame. Discretization and why it's necessary hasn't been covered on the online documentation yet, and we want to hide that complexity to non-technical users by encapsulating those behaviours in higher level templates: for example in that case AttractorPhysics could be a new template that contain both Attractor + Physics, and the discretization point to hide that from the FX artists.

Hope this helps :)

by HugoPKFX (17.7k points)