GDevelop-extensions icon indicating copy to clipboard operation
GDevelop-extensions copied to clipboard

[Curved movement] Certain easing functions cause TweenPathMovement to never finish

Open Granshmeyr opened this issue 8 months ago • 0 comments

Is there an existing issue for this?

Enter the name of the extension

Curved movement

Describe the bug of the extension

The easing functions "easeInBack" and "swingFrom" cause TweenPathMovement to never finish its movement. This means the Finished to move and Reached an end conditions never return true. The output of behavior.Progress() stops at 0.9999999999999998.

Steps to reproduce

  1. Clone MRP from https://github.com/Granshmeyr/GDevelop-CurvedMovement-MRP
  2. Run game
  3. Read the screen and scroll to "easeInBack" & "swingFrom"
  4. Notice how the square never turns green for these easing functions

GDevelop platform

Desktop

GDevelop version

5.4.203

Platform info

Windows

Windows 11 Home

Desktop

Additional context

Temporary solution is to evaluate the expression Math.abs(pathBehavior.Progress() - 1) <= Number.EPSILON or something similar to eliminate the obvious floating point error.

Granshmeyr avatar Jun 18 '24 00:06 Granshmeyr