Reverse lerp?

0 favourites
  • 3 posts
  • Is it possible to make a lerp that speeds up towards the end instead of slowing down?

    I'm currently trying to make a jumping system for an 8-directional character. It check's player's current standing position and records it on every tick, and when jump button is pressed, the character should lerp into say, Player_StandY -200, sending the player upwards. This part works well, but when I use lerp to send player back to the original position, the speed curve is wrong. The character slides quickly towards floor and slows down before impact. What I want is the reverse effect. The character should start falling slowly and gain speed while moving forwards, just like in real life.

    EDIT: Maybe I'm trying to do this the hard way and should use a platform behavior instead?

  • I would say 3 things:

    1/lerp is not meant, and should not be used the way I think you are using it (set Y to lerp(Self.Y, finalYposition, speed) I presume?), and it will also result in an anormal curve.

    2/a quadratic formula to increase the player speed to the bottom should be used in this kind of movement

    3/ The platform behavior actually does the 2/ by itself, so I think it would be wise to consider using it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright. I went with the platform method. It does the job so far. Thanks for the help

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