0 votes

I have a "balloon" Area2D node/scene, with a separate TweenExpand and TweenContract node as children under Area2D. At runtime, I am instancing a random number of balloons, and randomising the tween of the scale on the "_ready" function.

I have connected the "oncompleted" signals of the tweens back to the main parent Area2D script of the balloon scene...my question is, is the "oncompleted" signal just being sent to the individual balloon instance, or is it impacting all balloon instances? I really just want the signal to be instance specific, which I would imagine it is? i.e. each balloon instance receives a signal from its own child tween instances when they complete, not generally broadcast to all balloon instances.

in Engine by (42 points)

1 Answer

0 votes

Instances of a node are completely separate entities, so yes, the signal will just affect the node (or instance in your case) that sent it.

by (388 points)

If I have 50 balloons each with a tween in it. And the tween sends a signal when it completes to its parent balloon...,don’t all balloon instances receive the signal as soon as one tween completes?? That’s how it is wired (or one interpretation of it). My concern is I am wiring up a tween to effectively emit to its own parent node.

I'm pretty sure that an instance acts as an individual node, and so individually need to set up the signals. It's possible that they al have connected to the same function, and so that could be an issue if you don't reference the node that sent the signal within the function

I am setting up the signal connection in the inspector, and am instance going the nodes.

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 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.