How to prevent Rigidbody2D on enemy from Adding force on collision with the player

Hey, I have a 2D game in which when the player hits the enemy it loses a life, but when the player hits the enemy while moving its pushes the Enemy Away very weirdly and I don’t seem to find any solution, I am attaching the screenshot of Enemy RIgidBody and collider.

Here are the things That I have tried.
I tried changing the rigid body Type to Either Static or IsKinematic But that does not seem to work as the enemies start moving from the walls and every other thing has collider.
I tried freezing the x and y constraints but did the same thing, the enemy is moving from the walls.
I create a 2D physics material and set its Friction to a higher value but does not seem to work Either.

Any Other Suggestion is welcome!

video: link text

A few different options you can try:

  • give the enemy a high mass to make it harder for the player to push them
  • use a collider set to trigger, and use OnTrigger events instead of OnCollision. This will let you detect collisions without the objects pushing eachother. (You may want them to still have normal colliders so they can both collide with walls, but you can place the enemy and player in different layers which do not collide)
  • set the velocity of the enemy to zero after a collision