Is There An Easier/Cleaner Way To Make Things Show Up One By One?

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

Here’s the code I have right now to have things show up one at a time:

func _on_Timer_timeout(): # First timer starts automatically

func _on_Timer2_timeout():

func _on_Timer3_timeout():

func _on_Timer4_timeout():

func _on_Timer5_timeout():

func _on_Timer6_timeout():

All the timers are the same length. Could someone help me make this more convenient?

:bust_in_silhouette: Reply From: kidscancode

You could use an AnimationPlayer and set a keyframe for each node’s Visible property.

Video idea for you (if you haven’t already): Top 10 (or 100) Godot tips. (like this one).

duke_meister | 2018-07-10 06:02

:bust_in_silhouette: Reply From: eons

with timer in loop:

var timeout_count = 0
func _on_Timer_timeout():
  timeout_count += 1
  match timeout_count:
    1: do first thing
    2: do second thing
    _: $timer.stop() to finish the timer

But I agree with kidscancode, animation is better because you can make all the things visually and get the result you want easier.