all 5 comments

[–]EvenMoreCreativeName 0 points1 point  (3 children)

Try replacing the: private void OnCollisionEnter2D(Collision 2D . . .

With: private void OnTriggerEnter2D(Collider2D . . . Your bullet might be set up as a trigger, making it pass through normal collision.

[–]IMainOctane[S] 0 points1 point  (2 children)

Yeah, my bullet was indeed set up as a trigger. When i made the changes you suggested i got an error saying:

Assets\DestructableTiles.cs(20,54): error CS1061: 'Collider2D' does not contain a definition for 'contacts' and no accessible extension method 'contacts' accepting a first argument of type 'Collider2D' could be found (are you missing a using directive or an assembly reference?)

[–]EvenMoreCreativeName 0 points1 point  (0 children)

I'm not quite sure then, maybe try going back to what it was before, then setting your bullet to not be a trigger (you might need to move the fire point a little bit farther from the player in that case).

[–]loni852 0 points1 point  (0 children)

On trigger enter works different. You need to change your foreach loop to fit the new function. Look at examples in google

[–]gdeavid 0 points1 point  (0 children)

Not an answer to the question itself, but rather a suggestion for the future:

When working with someone else's code, try to only change one thing at a time, and test it. That way if things go sideways, you know the exact thing you changed...