Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FarbrorMartin |
I’m working on a project where you can split polygons with lines. Like cutting them in pieces.
I calculate the resulting polygon parts and child to a rigidbody2D and add a CollisionPolygon2D, and it kind of works but they have strange behavior. It looks like the polyogons have unbalanced mass, so they don’t always fall to the ground correctly. If I push them they move and roll sort of ok, but when they land flat on the ground sometimes the tilt back up again and come to rest on one corner.
The CollisionPolygon2D shapes are correct, and the polygons do register physics collisions as expected. I read somewhere that it could be the center of mass that’s off, but I don’t know how to adjust that.
Looking for advice on what I can do to fix this!
Edit: images don’t seem to work for some reason. The images just shows the polygon resting on a corner, instead of flat against the ground.