How to add durations to objects and simply animate them


#1

I am making an educational game that sometimes needs text pop ups. Is there a way to add a timer so that a text box only shows for a certain number of seconds?

Also is there a way to make the object move into the screen/fade in so that is doesn’t just appear?

Thanks!


#2

for timers

Action:
Reset Timer “TimerNameYouWant”

Condition:
If timer “TimerNameYouWant” is greater then x seconds
Action:
Do your stuff
Reset/pause or delete timer
https://editor.gdevelop-app.com/?project=example://objects-timers

For move objects into the screen take a look at Tweens.
https://editor.gdevelop-app.com/?project=example://tween-animations


#3

Thanks, that’s really helpful!

I only want this text box ‘incorrect’ to show for a couple of seconds so have added these actions but it doesn’t get hidden again. Have I done something wrong?


#4

its not triggered once, so your timer gets reset every frame and never reaches 2 seconds.


#5

Amazing! Thank you both :smile: :smile:


#6

you should make a subevent under hide incorrect and pause the timer.
then in your reset the timer event, you need to add unpause the timer.
no reason to have the timer run, if not needed.


#7

I’ve managed to add the animations to my objects (thank you!)

Is there a way to fade between different animations of an object rather than a sudden change? I can’t see it in the tween functions but not sure if it’s something I’m missing!


#8

?
You mean like blending 3d bone animations?
No, not possible.

If you want a transition animation, you have to make one yourself and change animation to you transition animation and then to your final animation, when you transition animation has finished.

depending on how advanced your transitions are supposed to be, you can get the current animation and their frames, to set your new animations depending on those information.
here an example of reversed animations, starting from the last frame it was in:


#9

Thanks Slash, that’s really helpful :smile: