Force Collision

I’m currently facing an issue, which I’m not quite sure how to resolve…

The player receives knockback of an enemy and gets pushed away. When next to a wall it can happen, that the player gets knocked out out of the room.

2024-05-2513-39-16-ezgif.com-video-to-gif-converter

I want the player and all the other objects to stay in the room. I’m using physics2 for the knockback explosion.

In addition I wanted to ask how I can prevent enemies to walk into the x and y of another so that they keep a distance. I know there’s collision, but it seems to push the enemies out of the room too…

Thanks for your help <3