0 votes

(I am using GDNative C++)

I want to connect the signal "tweenallcompleted" 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::forwardfinishmerge(...) 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?

Godot version 3.2.3.stable
in Engine by (104 points)

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.