I currently use a particle system where I need to be able to delete certain particles at specific locations with predefined objects or forms!
There are currently only Kill Sphere and AABox to destroy particles which might not be enough.
The best would be to be able to define a mesh, a collider in the VFX graph or directly in the scene with a gameObject, I don’t care. Basically I would like all the particles that are in this form to be removed.
I looked everywhere there is not really any information on this subject and normal there is little use of particle like mine I suppose.
Thank you in advance for your help !
PS: Sorry for my bad English it’s not my native language
As @XieJiJun suggested, you can add a Collide with Signed Distance Field block in your Update context and set the Lifetime Loss value to 1 (meaning particles will lose their full life if they collide with the SDF).
We added a built-in SDF baker in 2021.2 which you can access via Window > Visual Effects > Utilities > SDF Baker.
You can find a bit more info on how to use it in this video (starts around 19:32).
Once you’ve baked your shape, you can position it with the Field Transform value of this block.
Morning, as stated above if you need “precise” collision, SDF (Signed Distance Field) could be a good fit for what you’re looking for.
To simplify, “sampling” the SDF of a Mesh with your “Particle Position” will return the distance to the Closest Surface.
This distance value can either be “Positive” or “Negative” (signed) if the sample postion is Inside the Outside of the Surface. And a value of 0 would be mean that the Particle is actually on the Surface.
So with this, you can either use the “Sample Distance Field” Block operator , or directly use the “Collide with SDF” Block context.
Both of them would need you to provide an SDF as Input to know Which SDF to sample.
And you will also need to provide a “Transform” of the Mesh you want you’re particles to Collide with.
So the Steps would be:
Create a “3dtexture” exposed property
Create a “Transform” exposed property and set it to “WorldSpace”.
Create and Collide with “SDF” in the “update Context”.
Wire the Distance Field, and Transform Properties.
Set the Lifetime Loss to 1 ( Particles will Lose 100% of their Lifetime when colliding with the Shape)