How to Properly Create Bounce Effect with Tween

hey all. i’d like to create a bouncing effect with the tween behavior. when i’ve tried, though, i never get the desired effect. the object never bounces and returns to the original size of the sprite. how can i achieve this? it’s seen in the “game feel” demo, but i’d like to accomplish this with tweening instead of lerping.

Hi this is not with tweens but maybe helps you

With tweens the easy way is to set EasinOutBounce then play with the timing to execute the tween.

1 Like

How are you bouncing? Top down (as scaling would suggest) or side on?

Either way, you’ll need 2 tweens, and the best the Easing function to use would be EaseOutCubic for the way up, and EaseInCubic for the way down.

And it’s easier to use a relative target value, like object.scale+1 for the up, and object.scale-1 for the down (or object.Y()-50 and object.Y()+50 for the way up and down height changes respectively).

See this Easing Cheat Sheet for examples of how each easing type works.

1 Like

i appreciate the link, i’ll check this out. thanks

how would i place a buffer between the two tweens?
also, what do you mean by “top down” vs “side on”?

Top Down vs side on means
Top down or Platformer type

the bouncing i’m looking for is similar to “wobble3” in this link that ulises has kindly provided:

i’ve tried the extension, but it doesn’t seem to work properly. which easing function would i use for this?

1 Like

This refers to the game style, and where the camera is looking. Side on is the camera viewing from the side. As @Muzan wrote, it’s typical of the platform style game. Top down is a helicopter view, looking down on the playing area.


Move the object origin the centre of the object. Otherwise it’s set to the top left and the object expands diagonally down and right.

Wobble3 is more like the easeInQuad and easeOutQuad.

1 Like

thanks for the help. for the second tween that occurs on the way down, should i be using the event “check if the previous tween has finished”? it doesn’t seem to have any effect.

Yes. Here’s what I did:

and here’s the outcome:

StoneBounce

2 Likes

gotcha. how would i configure this to work on keypress/click? so far i have this:


but it seems to make the object continuously grow.

Add a “Trigger once while true” condition with the touch or right mouse button down condition.

I’d also suggest you remove the tweens once they have finished.

1 Like

it works now (after adding the trigger once condition and removing the tweens when finished)–thanks for the extensive help!

EDIT: upon further inspection, it seems that if the touch/mouse button is clicked repeatedly the object continues growing with each click. is there a way to solve this?

Yes, along with the “Trigger once” condition, add the condition that checks the tween “Shrink” isn’t playing (invert the tween is playing condition).

1 Like

you’ve been a great help. many thanks (: