Why isnt bouncing?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DarlesLSF

Hello all, I’m trying to create a bounce effect on my sprite, but thats what happens:
enter image description here

And here its my code:
enter image description here

The part where I want the effect its “e o retorno do herói” (the last one).

:bust_in_silhouette: Reply From: njamster

How large is the difference between the initial value (get_position()) and the final value (alvo) of the tween? If it is too small you may not notice the effect at all. Same for the duration: given how short it is (0.2) it might happen to fast to notice.

Alternatively you can create the bounce-effect yourself by chaining the interpolations using the (optional) delay-parameter of interpolate_property:

var initial = get_position()
move_frase.interpolate_property(self, "position:y", get_position.y, alvo.y, .1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
move_frase.interpolate_property(self, "position:y", alvo.y, alvo.y-100, .1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 0.1)

I changed the speed to 1 second and thats what happened:
enter image description here

I tried to change the distance between the initial and final points, but the result still the same. Idk what I’m doing wrong here haha

DarlesLSF | 2020-05-13 10:50

That’s strange. Can you upload an example project?

njamster | 2020-05-13 11:20

Here is: Test example

DarlesLSF | 2020-05-13 12:38

Your upload contains the already compiled project. Simply zip the directory containing your project as is. Do not export the project (using Project > Export) to a zip-file.

njamster | 2020-05-13 12:57