V
V
Vlad1222021-07-05 13:30:00
Unity
Vlad122, 2021-07-05 13:30:00

How to fix loose collider contact in Unity?

There is such a problem. The player is standing on the floor, but there is a rather small gap between their legs and the floor, but noticeable, although the borders of the colliders are perfectly aligned with the sprites. I know that there is a Default Contact Offset parameter in the project settings, but after reading some materials, I realized that it is better to leave it at 0.01, otherwise the accuracy in the collision of objects will be violated. It was also written somewhere that if a small gap is visible between the colliders, then you need to change the size of the sprites until the gap disappears. Is there anything else I can do (do not want to change the Pixels Per Unit parameter in the sprite settings or just change the scale parameter)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
K1ald, 2021-07-05
@K1ald

I would just make the colliders a tiny bit smaller than the size of the sprites.
It seems to me that sprites have an "invisible space" that creates a gap.
Solution: Either adjust the sprites more correctly, or play around with the sizes of the colliders.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question