0 votes

For some reason I'm getting this error [Signal 'bodyexit'' already connected to given method 'onAreabody_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.

in Engine by (273 points)

2 Answers

0 votes

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?

by (29,088 points)

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.

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 https://github.com/godotengine/godot/issues/6106

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

0 votes

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. http://docs.godotengine.org/en/stable/classes/class_node.html?highlight=duplicate#class-node-duplicate

Godot Version 2.1.3.stable.offical

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

Fixed code:
var selfDup = self.duplicate(true,6)

by (14 points)
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.