Goutte/godot-addon-animated-shape-2d

Help solving physics discontinuity

Goutte opened this issue · 1 comments

Goutte commented

This addon works great for hitboxes and hurtboxes.

But for solidboxes, sometimes it creates glitches in the physics engine due to the discontinuity of the boxes.

Example:

inscrutable-2024-01-08_06.49.55.mp4

The character gets stuck because its solidbox goes from a small square to a much bigger rectangle in a single physics frame.


To mitigate this, this addon could perhaps enforce some continuity using tween or something akin, making sure that the dimensions (and position) of the collision shape do not change too much each physics frame.

Goutte commented

I've implemented a new update mode, INTERPOLATE, to mitigate this effect, and it's working quite nicely in my preliminary testing.

I'm going to test it some more before publication.
Do ping me here if you want it and I forgot to push it.