Running into enemies moves them; how to stop this?

I’m creating a 2D Platformer with enemies. I want to make it so when you run into an enemy they don’t move. At the moment, if the player is willing to take collision damage, they can just push enemies out of the way.

The enemies need to be able to move themselves (like pacing) however, so I can’t just set it so they can’t move at all.

Ideas? I can get more specific and post code if it’s helpful as well.

Remove the rigidbody from your enemy. Or make a script that detects the player collision and overrides it.