Have projectile destroy some objects on collision but normally interact with others according to its properties.

I’m making a simple 2d game and I’m shooting a projectile (arrow) that has a collider on it and it’s hitting boxes that also have a colliders on them.

Depending on whether the arrow is on fire or not i want to

  • Normal Arrow : Bump on boxes, interact like normal physics object.
  • Fire Arrow : Destroy boxes and go through them - maintain current arrow speed, ignore collision altogether.

It seems that for the boxes selecting IsTrigger (and using OnTriggerEnter2d) solves half of my problem and not selecting it (and using OnCollisionEnter2d) solves the other half of my problem.

What would be the best way to approach something like this? (which surely has been done before in other games)

Hi, you could use a trigger on your fire arrow instead on your box. Box and normal arrows have colliders without trigger and fire arrows with trigger. When the fire arrow detect the box with OnTriggerEnter it destroy the box.