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

Godot addon to animate a CollisionShape2D along with the frames of an AnimatedSprite2D. Useful for making changing hitboxes, hurtboxes and hardboxes. Comes with an Editor, making things easy.
MIT License
130 stars 1 forks source link

Help solving physics discontinuity #7

Closed Goutte closed 10 months ago

Goutte commented 10 months ago

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:

https://github.com/Goutte/godot-addon-animated-shape-2d/assets/592545/8271ae14-d09d-427e-b4c9-1bba49f6faad

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 10 months ago

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.