Enemies get struck on collision

So I have a top down game, My problem lays is then when the character hugs the walls, the enemies end up getting stuck until I move away, to remedy this I’ve tried to make there collisions extremely small. Little bit of a better result but not good enough,

So I was thinking I could have 2 separate collisions on the wall. One for the player, and one for the enemy but the 2nd would be pushed way back so they can get at the player.

Would this Kill off performance in the long wrong? I know in the 3D world it would, but for pixel art stuff and regarding the engine I’m not sure ho much I should push it lol.

Is it 2D? It’s top down. How are the objects moving? Pathfinding? Forces? Or some other method or behavior.

Sometimes the issue is the enemy is targeting the default origin of the player (0,0 on the object) but the enemy is being moved from the center point. Or vice versa. It ends up pushing the enemy into the wall in certain cases. If you’re using the pathfinder, this can prevent the behavior from finding a path because it’s trying to go where there is a wall.

1 Like