How do I use lerp to make the hero bouncy/squishy looking?

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Is there a way to use lerp or some other function to give my main character a "bouncy" or "Squishy" look when it jumps, lands and moves? I've seen some tutorials on how to make grass and bushes move when you walk past them and I tried to apply similar settings but I haven't used C2 in so long now I've completely forgot what I was doing.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A simple way to make a character "squish" when landing is the following:

    On Landed:

    Player - set height to self.height*0.8

    Player - set width to self.width*1.2

    System - wait 0.1 seconds

    Player - set height to self.height/0.8

    Player - set width to self.width/1.2

    Basically, this will "compress" the sprite, making it look wider and shorter for a moment, then quickly go back to normal.

    I'm not sure what sort of visual effect to expect from a squishy character jumping or walking around, though - if you have something in mind, let me know and I'll see if I can help. Good luck!

  • That's a real nice effect, thanks

  • A simple way to make a character "squish" when landing is the following:

    On Landed:

    Player - set height to self.height*0.8

    Player - set width to self.width*1.2

    System - wait 0.1 seconds

    Player - set height to self.height/0.8

    Player - set width to self.width/1.2

    Basically, this will "compress" the sprite, making it look wider and shorter for a moment, then quickly go back to normal.

    I'm not sure what sort of visual effect to expect from a squishy character jumping or walking around, though - if you have something in mind, let me know and I'll see if I can help. Good luck!

    You can apply lerp to that too, to smooth it out.

    Something like:

    static x = 0;
    static landing=0;
    Every tick:
    Player set height lerp(0.8,1.2,x)
    Player set width lerp(0.8,1.2,1-x)
    if x >= 0 && landing==1: subtract dt from x
    if x <= 1 && landing==0: add dt to x[/code:vlrkzzn5]
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)