Godot Version
Question
So i have this function in my Hud scene and I’m planning to change the display text. So i only need this one function and when is called it should contain a display_time and Update: Double_Jump or Sprint or XY:
but i dont know what i should add, to tell the function. Okay display and text should be “Double jump press space” or “Sprint Press XY”
i thought of something like
match
jump:
text.line = XY
Sprint:
text.line = YZ
But thats the right syntax to use a string in the () like this display time.
i think there must be a easy solution, but im a newbie to coding
func display_controlling_hint(display_time:float):
animation_player.play("show_controlling_hint")
await get_tree().create_timer(display_time).timeout
animation_player.play_backwards("show_controlling_hint")
await animation_player.animation_finished
controlling_display_panel.visible = false