+1 vote

Basically I'm making a board game in which I move tokens on a board using a Tween. Two tokens can be merged, and when it happens I emit a signal to increase the score. The score variable is in an autoload script, so every token in the board is connecting a signal to this script. The thing is that I used the Tween.interpolate_method function to perform the animation, and it's inside this method I'm interpolating where I emit the signal to update the score. My questions are then: how does Godot handle these signal emissions? am I going to have any risk of race condition?

Someone in the chat has copied me this from the docs:

void move_child( Node child_node, int to_pos )
Move a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.

which suggests me this is already handled by the engine. I'm just concerned about the specific case of doing so while tweening.

Thanks in advance.

in Engine by (28 points)
edited by

Please log in or register to answer this question.

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 [email protected] with your username.