Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | The_Black_Chess_King |
GODOT REFERENCE VERSION: V3.0.6.stable.official.8314054
Howdy everyone, been a while, I am trying something that should be simple enough. But I keep facing a mysterious response, here’s my code:
func_ready():
$MyButton.connect("ButtonClickedFunction",self,"MyCustomFunction", [GLOBAL_ITEM,1])
#In short, MyCustomFunction deletes an item, this item is stored in GLOBAL_ITEM, and the quantity to delete is 1.
But it if I print the function argument 1:
MyCustomFunction(ItemToDelete,QuantityToDelete):
print(ItemToDelete)#To check what is returning in that connect code above.
This returns always the default value I stored in the global var despite any changes I make later, like an item select updating the GLOBAL_ITEM.
Do the connection with arguments only are defined once? Like constants?
Because printing only the global variable it displays any changes I made it later to GLOBAL_ITEM, but not when the Signal Function connect calls it.
Any tips?
Thanks in advance,