SOLVED From the position A to position B with Lerp

Get help using Construct 2

» 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
118
S
32
G
51
Posts: 1,896
Reputation: 38,559

» 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
B
175
S
50
G
200
Posts: 8,626
Reputation: 124,528

» 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
118
S
32
G
51
Posts: 1,896
Reputation: 38,559

» 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
13
Posts: 1,910
Reputation: 13,685

» Thu May 17, 2012 7:38 am

oh my i forgot :)
B
118
S
32
G
51
Posts: 1,896
Reputation: 38,559

» 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
40
S
17
G
5
Posts: 281
Reputation: 6,143

» Thu May 17, 2012 3:12 pm

Yes, code of what?
B
118
S
32
G
51
Posts: 1,896
Reputation: 38,559

» Thu May 17, 2012 5:26 pm

I mean the .capx for this
B
40
S
17
G
5
Posts: 281
Reputation: 6,143

» Thu May 17, 2012 7:48 pm

This is all:
B
118
S
32
G
51
Posts: 1,896
Reputation: 38,559

» Thu May 17, 2012 7:54 pm

Oh, that's it ? Lovely.
thank you :)
B
40
S
17
G
5
Posts: 281
Reputation: 6,143

Next

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], WindRiderZ and 1 guest