Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad collision normal between a circle and a convex polygon #54988

Open
Nuoska opened this issue Nov 15, 2021 · 0 comments
Open

Bad collision normal between a circle and a convex polygon #54988

Nuoska opened this issue Nov 15, 2021 · 0 comments

Comments

@Nuoska
Copy link

Nuoska commented Nov 15, 2021

Godot version

3.4.stable.official

System information

Windows 10

Issue description

Sometimes a collision between a KinematicBody2D with a CircleShape2D and a CollisionPolygon2D gives incorrect collision normals. This happens when the circle collides with a vertex, and the collision normal should point from the vertex to the circle.

#47185 looks like a similar problem but in 3D.

Steps to reproduce

In the minimal reproduction project there's a KinematicBody2D with a CircleShape2D of radius 50 and a CollisionPolygon2D. The circle moves over the polygon with move_and_collide() as if it was a character walking on a platform in a 2D platformer game. The circle can be controlled with arrow keys, and there's a green arrow on the screen indicating the collision normal.

The problem mostly happens if the movement speed is low, circle radius is high, and the collision happens far away from the origin.

Minimal reproduction project

CollisionNormalBug.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants