SOLVED From the position A to position B with Lerp Forum Home > Construct 2 General > How do I....? |
Post Reply
|
| Author | |
Post Options
Quote Reply
Topic: SOLVED From the position A to position B with LerpPosted: 17 May 2012 at 7:54pm |
|
|
Oh, that's it ? Lovely.
thank you :) |
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 7:48pm |
|
|
This is all:
|
|
|
Scirra tools are so COOL!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 5:26pm |
|
|
I mean the .capx for this
|
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 3:12pm |
|
|
Yes, code of what?
|
|
|
Scirra tools are so COOL!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 8:23am |
|
|
Hello Delgado,
is it possible for you to post the code ? I'll be very interested in :) |
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 7:38am |
|
|
oh my i forgot :)
|
|
|
Scirra tools are so COOL!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 7:37am |
|
|
Invert the "is touching" condition. ;) (Right click the condition and you'll see it)
Edited by Mipey - 17 May 2012 at 7:37am |
|
![]() |
|
Post Options
Quote Reply
Posted: 17 May 2012 at 7:14am |
|
|
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?
|
|
|
Scirra tools are so COOL!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 16 May 2012 at 11:28pm |
|
|
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. Edited by newt - 16 May 2012 at 11:46pm |
|
![]() |
|
Post Options
Quote Reply
Posted: 16 May 2012 at 11:03pm |
|
|
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 smoothly
Edited by delgado - 17 May 2012 at 7:39am |
|
|
Scirra tools are so COOL!
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |