Confusing Interactions Between 2D Colliders
Hello,
I'm experiencing weird behaviors between a box 2D collider and a circle collider. It's a very specific situation, but this issue is bound to come up in other places as well.
Below is a picture of a ball (gray circle) and a wall (white rectangle). The ball experiences gravity and is positioned EXACTLY so that the distance between the edge of the wall and the center of the ball is the ball's radius. Given this I would expect the ball to perfectly graze the wall and slide down in a perfectly vertical path without "hitting" the corner of the wall. In the picture, the straight blue line represents the movement I want, but what I get is a collision with the corner of the wall that causes the ball to move to the right slightly and follow the red path.
Would someone be able to explain briefly why this occurs and if there is any way to avoid it? I've yet to learn exactly how these colliders work. Thanks :)
hey , can u send a picture of the wall and ball colliders ?
Both the circle collider and the wall box collider are highlighted. In this picture the ball is at the same x-coordinate as before but next to the wall. The smaller circles are triggers, I know they don't cause the problem anyway because it persists if I disable them. Also if I just drop the ball from this point (below the wall's corner) it falls down vertically just fine.
Your answer
Follow this Question
Related Questions
Problems with raycasting 2D. Probelmas com raycasting 2D. 0 Answers
Physics 2D with tile collider corner problem 2 Answers
Is calling OnCollisionEnter2D on allot of GameObjects leading to worse performance? 0 Answers
Rule Tiles across different (ground/!ground) tilemaps 0 Answers
OnCollisionExit2D no longer gives contact information 0 Answers