Lerp startX stops before arriving at destination

Bugs will be moved here once resolved.

Post » Tue Mar 12, 2013 2:01 pm

Link to .capx file (required!):
https://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
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Tue Mar 12, 2013 2:47 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Mar 12, 2013 3:18 pm

damn, you right,
thx K
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Tue Mar 12, 2013 8:30 pm

BTW very interesting to use loose boundaries (X <= target.X+1)
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Tue Mar 12, 2013 9:33 pm

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)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Mar 12, 2013 10:32 pm

[QUOTE=California] BTW very interesting to use loose boundaries (X <= target.X+1)[/QUOTE]

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".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests