I already asked about this in the forum, but I wasn’t sure where the best place for this was, so here is my question:
I have a sprite for the player that has a box collider and a Rigidbody2D attached, and a box collider attached to the seafloor, a cube. What I would like to happen is for the player to be able to continue swimming normally, but not through the seafloor.
This is not what happens, though. The player sprite plummets to the seafloor (it did not do this before I added the collider) despite the gravity scale on the Rigidbody2D being 0. After doing some research on this, I suspected that it was because it is occupying the same space as a collider in the background game object which I can see when I put the scene in wireframe view. The issue is that the game object that makes the background (EasyWater2D from the asset store) does not have a collider component at all.
Also, that might not even be the issue, because when I take away the background, the exact same thing happens despite there being no visible colliders. I am quite mystified. Any ideas on why this is happening and/or how to fix it?