![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | fisox.zero |
By that I mean instead of is_action_just_pressed(“specific key”)
it would be any key.
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | fisox.zero |
By that I mean instead of is_action_just_pressed(“specific key”)
it would be any key.
![]() |
Reply From: | Zylann |
Use the _input
function callback:
func _input(event):
if event is InputEventKey:
if event.pressed:
start()
![]() |
Reply From: | CapybaraWEB |
I want to thank Zylann for the answer, I apretiate your time. For me, What did the trick was to check if the button was still visible, to avoid multiple signals. Im doing the 2d tutorial “Dodge the creeps”. God bless
signal start_game
func _on_StartButton_pressed():
$StartButton.hide()
emit_signal("start_game")
func _input(event):
if event is InputEventKey:
if event.pressed and $StartButton.is_visible_in_tree():
emit_signal("start_game")
$StartButton.hide()
hi like button
We have Input.is_anything_pressed()
(If anyone comes across this for reference)