Signal Errors

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vonflyhighace2
:warning: Old Version Published before Godot 3 was released.

For some reason I’m getting this error [Signal ‘body_exit’’ already connected to given method ‘_on_Area_body_exit’ in that object.] but there are no duplicate methods of the same name on any object in the scene? I think this is a bug.

I’m having this issue too. But I’m getting this error message instead:

E 0:00:01:0648 connect: Signal ‘changed’ is already connected to given callable ‘AnimationLibrary::_animation_changed’ in that object.
<C++ Error> Method/function failed. Returning: ERR_INVALID_PARAMETER
<C++ Source> core/object/object.cpp:1270 @ connect()

Entity2020 studios | 2023-06-04 09:52

:bust_in_silhouette: Reply From: Zylann

The problem here is that you have two connections to the same method. Although you have only one method, the signal body_exit has been connected twice to it. Check how you made this connection: did you do it by script? Or from the editor?

It was done through the editor. I figured out the issue though. I have a base enemy character that had the signals connected to it. I then instance the enemy into another scene and for some reason added the signals to that again, don’t know why. It would be nice if all modifications done on the base node showed up on instance nodes to help avoid these issues.

vonflyhighace2 | 2016-10-07 00:18

You mean, your enemy scene inherits the base enemy scene? I’d like to see if I can reproduce it.

Edit: indeed, if I inherit the base scene in another scene and instance this scene, I get the error. I think it’s a bug "signal already connected" error in inherited scenes · Issue #6106 · godotengine/godot · GitHub

Zylann | 2016-10-07 00:26

It seems that if you enable editable children on the instance this error appears. disabling it fixes the problem

vonflyhighace2 | 2016-10-07 00:54

:bust_in_silhouette: Reply From: joshpk105

I think I experienced the same issue. Every time I duplicated a node that had connected ‘area_enter’ signals and I used default flags I would get the error described above. My fix was to use the duplicate function flags to prevent signal duplication then add the signal after the duplication event.

I have provided the reference for the duplicate function. Node — Godot Engine (stable) documentation in English

Godot Version 2.1.3.stable.offical

Error Generating Code:
var selfDup = self.duplicate(true)

Fixed code:
var selfDup = self.duplicate(true,6)
selfDup.connect(‘area_enter’,selfDup,‘_on_Self_area_enter’)