Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | gcr | |
Old Version | Published before Godot 3 was released. |
It takes in the game from the script to assign different functions to the button click event.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | gcr | |
Old Version | Published before Godot 3 was released. |
It takes in the game from the script to assign different functions to the button click event.
Reply From: | ludosar |
Hi,
You have to assign the event to one function, and in that function you choose to call the other functions according to a value.
var a = 1
func _pressed_button():
if a == 1 : function_one()
if a == 2 : function_two()
if you want to change the button’s behavior, you just have to change the value of a.