(2D) Rigidbody slides a bit through Box Collider
Hi everyone,
I would like to create a high resolution 2D game, but I already encountered some difficulties with some basic game objects. I have a character (Rigidbody + Box Collider) with default settings (e.g. Mass 1, Gravity scale 60) as well as a floor (Box Collider).
Everything is fine so far. The character jumps and lands back on the floor properly. The problem appears when the character lands on the floor from a higher distance (e.g. a double jump or falling from a higher platform). As soon as the character hits the floor, it slides a little bit through it, then it's being pushed up slowly to the correct spot.
I assume this has something to do with the collision detection where the character passes the top of the box collider, then it's corrected by the physics engine. This is a common issue if the velocity of the character is very high, but this is certainly not the case. Actually it's relatively slow.
I edited my original question because I thought the problem might be the high resolution in which the character has to move more pixels to travel a certain distance and behind the scenes this is also considered a fast movement. But I tried it with a low resolution and small orthographicSize, and the problem persists.
Short video of the issue: https://www.dropbox.com/s/8a90123ww86915y/moving.mov?dl=0
Anyway, is there any way around this problem (other than continuous collision detection)?
Thanks in advance!
Answer by sohawkus · Dec 02, 2019 at 03:12 PM
What? This question is already have 3 years and still not have an answer? WHAAAT?
It seems that the Unity community is the deadest community I've ever seen))
LamiaSoft, maybe you find for this 3 years how to fix this? Do you find how to solve your problem with character slides slighty into box collider?
Your answer
![](https://koobas.hobune.stream/wayback/20220612085937im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
No overload for method. (Question) 0 Answers
rigidbody not moving 1 Answer
FixedUpdate or Update for collision detection and climbing slopes? 1 Answer
Physics 2D with tile collider corner problem 2 Answers
2d Moving Platforms 1 Answer