• 2D
  • how to have collision polygon 2d follow the shape of polygon2d mesh deformation?

As you can see from this image, my collisionpolygon2d's shape is not following the polygon2d that's being deformed by the skeleton. How can I have it always match?

Do I need to manually copy the points every frame with a script? It's only 13 points, it'll be fast, but is that the only way?

Do I need to manually copy the points every frame with a script?

Indeed, you probably need to do that. I don't know any built-in way to synchronize them. That said, collision polygons were probably not designed to be changed every frame, so physics glitches may occur if the polygon enters solid geometry while it's being edited.

7 days later

If I move the bones, the original mesh polygon points do not seem to change. That's strange... How can I access what they are currently?

See how much object isn't in the center of its points anymore?

This is the reason I cannot just copy the polygon shape to the collision shape.

I think you can copy the vertices by setting the polygon property of the CollisionPolygon2D to the polygon property of the Polygon2D node, but I’m not 100% sure.