Making a 2D platformer not go backwards.

Ok, I’m sure this question has been covered before, but I can’t seem to find the right keywords.

I’m making a 2D platformer, and I want to make it so that the main character can’t go back past the camera bounds on the left (like in Super Mario), so I put a big long collider box on the bound of the left camera. Now the enemy can’t run past the left camera bound…but it also pushes all the enemies along with it. I want everything to be able to go through the collider but the player.

So, do I need to use layer based collision? The problem is, I can’t seem to get the collider not to affect everything else. Any ideas?

Why not just check that the player isn’t a certain distance away from the camera along the horizontal axis? If the distance is 30 to the left, the player controller won’t move that way anymore, and if it is more than 30 the camera will move to the right, for example. This is just a general idea, but that’s the direction I’d go for a 2D platformer…