0 votes

The Title pretty much says everything, but let me explain in better detail. I have players with cards in a node called Hand, eventually in the game I need the last player to show the first player his cards, and first player select a few to exchange with last player. But the cards in the hands have signals connected to the players (to know when the player selected such card)

In order to do so, I get the players Hand, remove it from the player and set on the Table tree adding it in a hand_placeholder node (in a way only the trading players can see the cards in an internet multiplayer environment).

Do I need to rewire the cards' signals with the player, or better asking, is it possible to rewire the cards with the players since they are not in their tree path anymore?

in Engine by (12 points)

1 Answer

0 votes

If by "deleting" you mean using remove_child and then add it somewhere else with add_child: no, existing connections won't be closed. You have to take care of that yourself using is_connected and disconnect.

If by "deleting" you mean using queue_free or freeand then add a new instance of it somewhere else with load("<ScenePath>").instance() then the new instance will only hold connections created in the scenes script.

by (10,483 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.