I get EMIT SIGNALP ERROR - can not convert argument 1 from object to object:

  1. Can I connect signal from a node back to itself- (otherwise when body entered it is not detected); however the emit signal is seen under node but disappears against the code line when Godot rebooted- hence the error in debug;
    ..
  2. Also this error occurs when multiple instances created using same script (it is not practical to create separate signals code for each instance.
    ...
  3. How to keep signal recognized on a scene not listed in current scene tree, but instantiated from res:/ , such as bullets. Same error.

Everything works despite the error.
From research, this seems to be a bug (GDScript to C++). I have also tried "multiplayer. allow_object_decoding = true" - did not work.

How would I delete such errors runtime (web export)? The game may never be closed and stack a huge error log file (- player number and frequency dependent).
Redrc

  • Toxe replied to this.

    Here are 2 samples:

    In the 1st one, one script is used for multiple instances of water.
    In the 2nd one, the green signal icon indicator has disappeared from left of code line, but still present in node list on the right.

    Are you connecting signals using the Inspector, in code, or a combination?

    actually, body should be agnostic

    what if something other than characterbody2d enters the area? then what?

    You chould check if the body is character type then if its in group then do something. IMO.

    Thanks Toxe, Dave, Kuligs.

    I'm connecting signals from inspector (node tab).
    Nothing else enters the area except Player. But these errors pop up at first ready, even without any player interaction or movement.
    Everything works perfectly despite the errors.

    • xyz replied to this.

      Hi xyz, thanks,
      Yes - you're right!
      This is what it defaults to anyway: (body: Node2D) - all tuts I was following were more node-specific, such as in my code- which still works but fills up error logs. This seems to affect only auto-generated ID's on multiple instances, however not copies manually given a suffix.
      THANKS for the solution.
      ...
      Hi Kulligs, I see your point. By "agnostic" do you mean underscore "_body" ?
      I found previously putting underscore helped to remove "yellow" information errors- however it didn't remove the red errors.
      But I'll keep it in mind for future reference- multi-body scenarios. Thanks.

      There still remains an unanswered question: why the green signal icon disappears against the code line when Godot rebooted, for self-connected nodes? And is it ok to connect a node to itself, or is there another way for detection to work?

        redrc i meant type agnostic, not a character type but a base type usually node or variable type when you dont know what type it could be..

        the underscore i think means that you mark it as not used variable and godot wont throw errors like you said

        redrc There still remains an unanswered question: why the green signal icon disappears against the code line when Godot rebooted, for self-connected nodes? And is it ok to connect a node to itself, or is there another way for detection to work?

        Maybe they are not really connected. Double check that.

        It's perfectly fine to connect to self.

        Thanks guys - SOLVED!
        Appreciate your help.
        Everything works - without those errors.
        Yes -connected and working, and showing in inspector/node, just not showing against the code line for some reason.
        Otherwise this topic is SOLVED!

          redrc changed the title to EMIT SIGNALP ERROR on MULTIPLE INSTANCES & SELF CONNECTION -SOLVED! .

          redrc i connect signals in code, because the interface is buggy and then you forget what signal was where conencted and when you move/delete nodes around then sometimes it get too convoluted..

          connect them in _ready() function and bob will be your uncle.