Positions of the objects in scene view and game view not the same.

We are making a pretty simple 2D side scrolling platformer. We noticed after a while that the player used to fall through colliders the end of platforms, so we it thougth it was a problem with the collision system, but turns out the object has different position in the scene and the game view. Notice in the attached pic that this would make the player seem like he’s on a platform in the game view, while in the scene view this is not the case, causing him to “fall through” the platform.

Answering myself. I was using a perspective camera, but since Z fighting was a big issue, I forced the camera transparency rendering order to be orthographic like so

GetComponent<Camera>().transparencySortMode = TransparencySortMode.Orthographic;

which led to the displacement. Important take away, if your game view and scene view are inconsistent, check if it has something to do with the camera.