Why do i have to specify inventory before the connect, to make it work? I've tryied without and the test doesn't pass.
Is it because the signal is emitted by the Inventory resource, and i'm scripting on the Charachter script?
So, if i have a custom signal, on the receiver end, i have to instantiate a resource of that type and then connect with it, otherwise signals are lost?
Hope i've explained well my question, i'm not sure myself of what i'm asking XD
Hey Roby! I believe your thinking is correct as far as I understand. Basically what the difference is between
"inventory.connect("left_hand_changed", self, "_on_Inventory_left_hand_changed")
vs
"connect("left_hand_changed", self, "_on_Inventory_left_hand_changed")
is this
the first is connecting the "left_hand_changed" signal of the inventory object to our own "_on_Inventory_left_hand_changed" method
the second is connecting our "left_hand_changed" signal to our own "_on_Inventory_left_hand_changed" method
Do you see the problem there? the second one is trying to connect to a signal that doesn't exist. We (the node this script is attached to) don't have the "left_hand_changed" signal. That signal is on the Inventory object.
I hope this clarifies things for you, let me know if you have any follow up questions.