(Beginner) Adding a 2D Collider Randomly moves Player Off-screen when Game Starts!

Hi Everyone!

I’m a Unity beginner and I am facing what is probably a simple problem, but I just can’t seem to find the issue. My problem is that whenever I enable the 2D Box Colliders for the walls, my Player moves off-screen the moment I run the game.

As you can see below, I have three walls with Box Colliders and a player. When I run the game without the Box Colliders enabled, everything works as intended (except that the walls don’t have colliders, of course).

However, when I run the game with the Box Colliders enabled, my player for some reason drops below the camera immediately as the game starts (refer to picture below).

Please note that I do not make any changes in my code between these screenshots. The only thing I do is starting/stopping the game and enabling/disabling the Box Colliders for the walls. I’m probably making a really dumb mistake, so please point out anything you see. Thank you so much! I have so much to learn.

go to edit–>Project settings
you will find checked boxes
those are the layers, I think
it indicates which gameObjects collides with another gameObjects

you must have given a layer to the walls. Uncheck the boxes of the wall’s layer next to the player layer
if you do that the player won’t collide with the walls
and the player won’t jump of the camera

i apologize if the explanation is crap and that i answered it late
i am new to unity as well. I started 3 months ago

I had the same problem for hours! When I added a Box Collider 2D or Circle Collider 2D, it would slide off the screen, ignoring the colliders. I did add some screen bounding, but this didn’t fix the issue.

I did find a solution to the problem though. Go to Edit > Project Settings > Physics 2D and make sure X & Y are both set to 0. My Y was set to -9.73.