Though I haven’t used it yet I know I could use colliders for every particles but that’s expensive so it’s not what I want in this case.
I want to create one collider that roughly fits the particle system, so far I used animation clips to make the collider scale accordingly with effect. The problem comes when I want to change the FX once more, I must also change the clip and it quickly gets tedious to try out many variations in game.
Is there a solution to this problem? How do you guys make your colliders fit your particle effects?
(in this example, I created a burst of water, I want to try out different variations where the burst could be wider or the burst takes longer… This affects the ParticleSystem only however, not the hitbox)
Perhaps consider using the Marching Cubes algorithm to create a voxel grid from your particles, and turn that into a mesh. Then use it as a mesh collider. This will likely be too slow for realtime but you could precompute the collider with this technique.
Thanks for helping out Richard, that’s interesting though it sounds like a complicated solution for what I need right now.
But I may be wrong.
My game is entirely 2d.
The idea is to create a single collider that gets modified over the duration of the effect, is this achievable or must I necessarily create lots of colliders that get activated/deactivated?
I eventually want this single collider to be used with the OnTriggerEnter2D() method. Having several colliders would complicate this.
EDIT: I previously did that with Animation clips: simple scale of a boxcollider or a polygonal collider… But that method is quite constraining because the shape can only grow or shrink not drastically change.