- Home /
My collider is offset from where it appears in the scene editor when I'm in gameplay mode
I'm building an isometric environment in Unity and having some trouble with my colliders aligning with what shows in the scene editor to the reality in gameplay.
There is nothing in the collider component to indicate that it should have any offset, or that there is anything at play other than the default settings. This goes for all types of 2D colliders I should add. I did try a 3D collider just out of curiosity, and nothing happens at all. This has been my experience with multiple objects, not only the one I've highlighted in the picture below.
I'm using the Adventure Creator add-on if that makes any difference.
The picture below shows where the Scene Editor says the collider should be, while the red circle is what I'm actually colliding with in gameplay mode.
Did you figure this out? I'm having the exact same problem while going through the Ruby's Adventure 2D tutorial.
I am also having the same problem in the Ruby tutorial; specifically between Ruby and the $$anonymous$$etalCube..
BU$$anonymous$$P. Seeing exactly the same in a 2D platformer. Capsule Collider on the player is perfectly colliding with edge collider on the ground in Scene view (with gizmos enabled so I can see the colliders). However in the game there's an offset that I can't get rid of, resulting in player floating above ground. If I try to fudge it by offsetting the collider manually, it becomes unpredictable - sometimes collider is offset, other times it isn't - causing player to appear sunken in ground
Answer by neilybod · Apr 16, 2020 at 12:01 PM
I finally figured it out. In my case, i think it was caused by Transform.z on the player being non-zero. In a 2D game (or even a pseudo 3D one like isometric), Z probably always should be 0, or at least the same as the other gameobjects it needs to collide with.