diff --git a/engine/system/physics.ts b/engine/system/physics.ts index 58a4f4b..e0303c8 100644 --- a/engine/system/physics.ts +++ b/engine/system/physics.ts @@ -351,6 +351,10 @@ export function moveAndSlide( } const time = closest.time; + // if the collider overlap already + if (time === 0) { + break; + } const scale = Math.max(0, time - 0.001); position.x += velocity.x * delta * timeLeft * scale;