VFX particle attraction

Options
Joshua Beckwith
Joshua Beckwith Posts: 18 🔥
edited October 2022 in Custom Material Creation #1

I know there's an attraction node in the vfx editor, but I'm struggling to make it work how I need it to. Basically, I want to apply an initial velocity to the particle when it spawns, then have the particle attraction set to the initial spawn location. It should try to return to where it started.

I tried storing the original position in an attribute, then comparing the current and start position to set a directional force, but I'm getting this sort of generic looking lissajous curve behavior.

Project files

Answers

  • Bakari Mustafa
    Bakari Mustafa Posts: 178 🔥🔥🔥
    Options

    One way to achieve the behavior you're looking for is to use a combination of an Initial Velocity node and a Force node. The Initial Velocity node can be used to set an initial velocity for the particle when it spawns, while the Force node can be used to apply a force that is directed toward the particle's initial spawn location.

    To accomplish this, you should use the particle's initial position, which could be stored in an attribute, as the target position for the force node. Then, you should use the Force node to apply a force that is directed toward that position. This will cause the particles to move toward their initial spawn location.

    The direction and strength of the force can be adjusted by changing the settings of the Force node. The strength can be adjusted by modifying the strength parameter, and the direction can be adjusted by modifying the direction parameter.

    You can also experiment with the different force types (eg. Radial, planar, uniform) and the damping, which will help you achieve the exact behavior you're looking for.