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

CollisionPolygon2D build mode segments #87347

Open
Flyboy1010 opened this issue Jan 18, 2024 · 2 comments
Open

CollisionPolygon2D build mode segments #87347

Flyboy1010 opened this issue Jan 18, 2024 · 2 comments

Comments

@Flyboy1010
Copy link

Tested versions

  • Reproducible in Godot 4.2.1.stable.mono

System information

Windows 10 Home - Godot 4.2.1.stable.mono

Issue description

I am making a worms type game using 2d collision polygons as colliders for the map, the problem comes when I use segment build mode for the polygons along with the "default 2d character body controller" which causes the character to make a weird vibration in some corners or even on flat terrain.

This doesn't happen when I use solid build mode, but I really need to use segment mode because I also have holes in the terrain which are also 2d polygon collisions with segment build mode.

With rigidbodies instead there seems to be no problems with either build mode.

Weird corner vibration

collision1.mp4

Flat terrain vibration

collision2_with_rigidbodies_as_well.mp4

Note: I using a custom marching squares algorithm for tracing the contour of the terrain, that also takes into account holes, but i dont think there is any problem with that.

Steps to reproduce

Run the proyect and collide with the corner seen in the first video using the left and right arrow keys to move and space for jumping, you can pan the camera with the right click, you can spawn a rigidbody with the left click, and zoom in and out with the up and down arrow keys

Minimal reproduction project (MRP)

Worms-clone.zip

@rburing
Copy link
Member

rburing commented Feb 13, 2024

May be fixed by #88282 (I didn't manage to test with C#).

Edit: I managed to test it, it's not fixed by that PR.

@abubakriz
Copy link

I ran into the same thing on my own...
I am trying to make a 2D battle arena "box" where the player cant exist, currently Im using Line2D for the outline of the arena and then copying the points directly into CollisionPolygon2D.

With segment mode, I can break out of the box, the collision is janky and vibrates, and similar stuff to what happened here.
Just sharing in case this helps find the bug

Godot v4.2.2.stable - Windows 10.0.19044 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1660 Ti (NVIDIA; 31.0.15.4584) - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 Threads)

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

4 participants