Lerp startX stops before arriving at destination

0 favourites
  • 6 posts
  • Link to .capx file (required!):

    dl.dropbox.com/u/91685197/lerpDragShaderUpdate.capx

    Steps to reproduce:

    1. Run the script

    2. Drag and release, repeat, maybe will show on first or after ten tries.

    Observed result:

    Stops before arriving at startX

    Expected result:

    Should stop at start.X (named aquaBlock.X)

    Browsers affected:

    Chrome: yes

    Safari: yes

    Operating system & service pack:

    Windows XP SP3

    Construct 2 version:

    r121

    That's Auntie Val capx, I tried to reproduce the code from scratch and still notice that dragged items stops before arriving to start position.

    thx

  • I don't think it's an issue with Construct but rather with your code.

    The only way I could observe the result you talked about was when I caught/dragged again the item when it was coming back to the start.

    Look this example, I'm making it so you can't drag again the object before it went back to the start.

    And so I can't make it stop like in your project.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • damn, you right,

    thx K

  • BTW very interesting to use loose boundaries (X <= target.X+1)

  • Closing since this is insufficient evidence the bug is not just in your events; make a new example from scratch using minimal objects and events if you wish for this to be investigated further.

    (FYI 'lerp' is a single line of code in the source, so I think it's extremely unlikely there's a bug with it! Also note if you use lerp with moving objects, it can become non-linear)

  • BTW very interesting to use loose boundaries (X <= target.X+1)

    As you notice in the text object, the value returned by lerp is a (big) float.

    So waiting for the exact value of Start.X and Start.Y takes quite some time.

    Checking for a 2 pixels range makes it more "intuitive".

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)