SOLVED From the position A to position B with Lerp

Get help using Construct 2

Post » Wed May 16, 2012 11:03 pm

I use when 'is in touch' go to position- lerp(touch.X,0,0.01) and lerp(touch.Y,0,0.01) but my character are 'teleported' to this place only, not smoothlydelgado2012-05-17 07:39:02
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,555

Post » Wed May 16, 2012 11:28 pm

What happens when you say set x to x + 1?

Also:
You might think of it terms of lerp(start, end, percentage)
Where the percentage is expressed in terms of 1 to 0.00, and 1 is 100 percent.
In this case the percentage is not as important as what is changing in the start. The percentage is the time element, usually expressed using delta time.
lerp(self.x, touch.x, 1*dt)
In this equation self.x is always changing, and so does touch.x, if you move the touch, but self.x only goes to a percentage of the distance between self.x, and touch.y, as long a the percent is within the range of 1 to 0.00.newt2012-05-16 23:46:53
Image ImageImage
B
168
S
50
G
164
Posts: 8,236
Reputation: 105,591

Post » Thu May 17, 2012 7:14 am

Yes, now its working fine ! But i have another question. My character follow perfectly to touch position but i want to character always back to 'start position' when im not touching screen. This is no option like'is not touching' do something. How handle this?
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,555

Post » Thu May 17, 2012 7:37 am

Invert the "is touching" condition. ;) (Right click the condition and you'll see it)Mipey2012-05-17 07:37:58
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,170

Post » Thu May 17, 2012 7:38 am

oh my i forgot :)
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,555

Post » Thu May 17, 2012 8:23 am

Hello Delgado,
is it possible for you to post the code ? I'll be very interested in :)
B
32
S
14
G
5
Posts: 232
Reputation: 5,502

Post » Thu May 17, 2012 3:12 pm

Yes, code of what?
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,555

Post » Thu May 17, 2012 5:26 pm

I mean the .capx for this
B
32
S
14
G
5
Posts: 232
Reputation: 5,502

Post » Thu May 17, 2012 7:48 pm

This is all:
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,555

Post » Thu May 17, 2012 7:54 pm

Oh, that's it ? Lovely.
thank you :)
B
32
S
14
G
5
Posts: 232
Reputation: 5,502

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, stevenode and 1 guest