Single input condition Lerp action

Get help using Construct 2

Post » Sun Aug 07, 2016 8:43 am

Ok, this seems harder than it should be, so I'm probably missing something basic. Long story short, the functionallity I need can be described as such:

I use the mouse button clicked, and then a set FX param lerp condition. How do I make the lerp go all the way from the a value to the b value by the c ( the percentage) on every tick and not just do it once?

I tried doing a function which is called on every tick but I suspect I have to update the (a) value every time I call it and there has to be an easier way.

Thanks
Cheers!
B
18
S
3
Posts: 65
Reputation: 994

Post » Sun Aug 07, 2016 4:31 pm

First, the "lerp" doesn't work on triggers.
Second, the use of lerp is to progressively change a to b every tick or delta-time(dt) using (c).

Syntax: lerp(a, b, c) every tick or lerp(a, b, c * dt) for optimization.

If that is your goal then, you are on the right track.

Third
If you want the mouse for lerp then I suggest you use a variable or boolean.
For example:

global number variable (Switch = 0);
global number variable (A = 0);
global number variable (B = 0);
global number variable (C = 0);

*global variable Switch > 1
->global variable Switch set to 0

*On Mouse click.
->Add 1 to global variable Switch.

*global variable Switch = 1
->Set scroll to x (lerp(A, B, C * dt).

Hope that helps.
BTW, that event is for scrolling x.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
67
S
22
G
90
Posts: 1,125
Reputation: 60,036

Post » Sun Aug 07, 2016 6:51 pm

Damn, should have thought about that! Hey Thanks a mil! This will def do the trick
B
18
S
3
Posts: 65
Reputation: 994


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests