Avoid physics from collision

This is hard to explain, but here goes.

I have two different colliders, let’s call them playercollider and rockcollider.

Let’s say rockcollider is at a specific position, but in one single frame, playercollider spawns in the same position.

What I want to happen: playercollider spawns at the position given, and disables rockcollider’s renderer & collider. So it seems the rockcollider is destroyed. I basically want my playercollider to be a bulldozer, that can’t be pushed around.

What actually happens: The playercollider is “pushed” outside of the rockcollider, and then it does the job by disabling components.

So what do I need to be aware of? I’ve tried tons of stuff. Adding physics material with 0 bounciness, toggling/untoggling isKinematic, etc.

If you’ve read this and still don’t know what my problem really is, please say so - and I will edit this question.

And btw. this is a 2d game.

How about just checking if the players “to be” spawn location is within the rocks collider.bounds?

Contains

For more precision you can take the closest point within the rock to the player’s to be spawn position:

RockCollider.bounds.ClosestPoint(playerPosition) 

Then check to see if the distance between that point and the player is greater than half the width of the players collider.

ClosestPoint