Attach the same node to a single signal, multiple times, with diffirent arguments.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hugo4IT

(I am using GDNative C++)

I want to connect the signal “tween_all_completed” to a function that takes some parameters (2 Vector2s for 2 2-dimensional array indices). I assign it like this:

animation_queue->connect(
    "tween_all_completed", parent,
    "forward_finish_merge", Array::make(Vector2(y, x), Vector2(y+1, x)));

To this function:

void Game::forward_finish_merge(Vector2 item_c, Vector2 item_c_below) { game->grid.finish_merge(item_c, item_c_below); }

Which forwards the function back to the original sender (The script that connected the tween, not a node thats why this weird forwarding):

void Grid::finish_merge(Vector2 item_c, Vector2 item_c_below) {...}

I’m getting the error:

ERROR: connect: Signal 'tween_all_completed' is already connected to given method 'forward_finish_merge' in that object.

It only executes the Game::forward_finish_merge(…) once. I get what the error is saying, I just don’t understand why it isn’t possible. Is there a way to ignore what the error is saying, and just continue emitting signals?