Search Unity

Particles starting position

Discussion in 'Visual Effect Graph' started by IMTactica, Feb 25, 2020.

  1. IMTactica

    IMTactica

    Joined:
    Oct 16, 2019
    Posts:
    19
    Heya, folks.

    Is it possible to set VFX Graph particles starting positions using an array of positions?

    Thanks in advance.
     
  2. peeweekVFX

    peeweekVFX

    Joined:
    Oct 19, 2015
    Posts:
    14
    You can, and while arrays in VFX Graph are not supported yet, the current practice is to bake these positions into a texture (position Map, or point cache) then use the "Set Position from Map" block.

    For Position Maps in scene, you can expose a Texture2D and an int for the point count, then use on your game object a Multiple Position Binder, that will perform the baking of points into a texture, then bind it to the texture/count properties.

    If you need to spawn from a mesh surface / texture pixel positions, you can also bake a Point Cache using the Point Cache Bake Tool (Window/Visual Effects/Utilities/Point Cache Bake Tool). This solution enables basic configuration to generate the point cache asset. When exported you can reference it in a Point Cache Node that will populate the point count and the positions (you can also bake more mesh/pixels attributes if you want)

    Finally, if you need really complex position baking the most custom solution is to use Houdini and the pCache exporter (available in VFXToolbox)
     
    pierre92nicot likes this.
  3. IMTactica

    IMTactica

    Joined:
    Oct 16, 2019
    Posts:
    19
    Thank you for the information, @peeweekVFX.
    I will try it out.