Hi everyone, i’d like to ask you about a problem i ran into, relating to colliders. The title is explanatory…
reminder: we’re talking about physics and collider 2D (the new tools).
The attached image shows in the bottom part, the Player colliders (typical sphere for the feet and rectangle for the body) and a Ground on the left.
The Ground has two colliders: one of the Ground shape (with some material and friction) and a outer one just on the edge ( small rectangle with no friction). This is done for preventing the player to stuck on the ground side if some force is applied (during movement while falling for example).
If you look at the bottom part of the image, you may notice that the player collider got stuck…bringing the character to the edge and letting him fall MAY after some attempts results in this scenario.
You can’t still notice, but the sphere, if you zoom in, isn’t really touching anything.
In fact looking at the image above, I’ve removed at runtime the sphere collider and discover that the collider causing the block is the rectangular one.
As you may notice it’s not touching anything, nor any input is given at this point.
I use a simple script (inspired by the last unity 2d lesson) for player control, and collision detection. Anyway this should be irrelevant.
So summing up:
-
Seems that an external collider (the circle) does not cover the inner one (the rectangular) as intuitively expected. It seems that the rectangular collider got stucked by himself.
-
Also…the colliders aren’t touching, but the player’s one is still on the air. Is this a gui problem?
Any help would be really appreciated…
Thank you in advance