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
98
S
22
G
35
Posts: 1,847
Reputation: 28,898

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 Image
B
163
S
48
G
99
Posts: 7,433
Reputation: 71,488

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
98
S
22
G
35
Posts: 1,847
Reputation: 28,898

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,155

Post » Thu May 17, 2012 7:38 am

oh my i forgot :)
B
98
S
22
G
35
Posts: 1,847
Reputation: 28,898

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
23
S
10
G
4
Posts: 201
Reputation: 4,263

Post » Thu May 17, 2012 3:12 pm

Yes, code of what?
B
98
S
22
G
35
Posts: 1,847
Reputation: 28,898

Post » Thu May 17, 2012 5:26 pm

I mean the .capx for this
B
23
S
10
G
4
Posts: 201
Reputation: 4,263

Post » Thu May 17, 2012 7:48 pm

This is all:
B
98
S
22
G
35
Posts: 1,847
Reputation: 28,898

Post » Thu May 17, 2012 7:54 pm

Oh, that's it ? Lovely.
thank you :)
B
23
S
10
G
4
Posts: 201
Reputation: 4,263

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests