Single input condition Lerp action

0 favourites
  • 3 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • 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.



  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.


    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.

  • Damn, should have thought about that! Hey Thanks a mil! This will def do the trick

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)