- Home /
Can Particle System ignore a given collider?
Physics.IgnoreCollision is handy to prevent collision between two given colliders. But is there something similar for avoiding collision between particles and a given collider?
I need particles from a system to collider against most objects, but also need to make sure each particle system ignores colliders from their own shooter, while still able to hit other shooters.
Fiddling with colliders to avoid collision is not an option, as arms are controlled individually and characters shape may vary due to customization.
Using Layers also can be very messy in this situation, as there can be many characters and I can't define that many layers for projectiles and targets.
I appreciate all suggestions.
Answer by karl_jones · Aug 28, 2018 at 09:43 PM
No but we will look into how we can improve things so that this is possible in the future.
I see. If there are any known workarounds I could use for now, I would appreciate suggestions.
Thanks, $$anonymous$$arl.
you can only use the layer mask system. maybe you could temporarily switch a collider to a special "ignore" layer when you want it to be ignored?
I thought of it. But this would also get the shooter colliders to be ignored by other shooter's projectiles (while shooting). I will try using using particle triggers ins$$anonymous$$d of collision. If it works, I will add another reply here. Thanks Richard.
@Georodin : Which works so long as you don't want shots that can also hit enemy shots. That change alone takes your 5 layers up to 10 layers. Then what about shots that can/can't hit scenery? Each flag doubles the number of layers. As the OP says, using layers is too limiting and can't replace a proper solution. Furthermore you can't use particle triggers as you can colliders and have to do some odd set-up. Hence my flame-thrower has flames that hit and bounce off objects. Shuriken was clearly designed around a certain game concept, like Unity itself, and games that don't fit that $$anonymous$$dset really struggle. For those looking for robust, versatile solutions, really you need to roll your own 'particle system' managing a collection of objects.
Answer by Fritte · Nov 06, 2020 at 05:58 PM
For everyone looking for this now: In the particle system under "collision" and "Collision Quality" there is an option to chooses all layers, the particles can collide with. It is called "Collides With". (Unity 2020.1.6f1 - URP)
Unity's reliance on layers is uselessly outdated. Has caused me nothing by misery in my space shooter where I need weapons to be able to interact with different types of objects. I'm guessing this will never be addressed for particles as Unity want to move to their Entity system, eventually, years after we're needing solutions. For now, I found this trying to find a solution to my using a particle-base flamer colliding with the firing ship when it's moving quickly. Absolutely ridiculous you can't exclude a firing object from interacting with the particles its firing!