Error 31 ( "Signal" error on connecting signal between two different scenes)

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

There is a similar open issue on Github,but its been open since “2016”.

Meanwhile If there’s any solution found , please share.

So,while trying to manually connect a signal("bullet fire") from one scene(player) to another(game) {passing a packed scene(bullet) , along with other properties } , Godot returns error code 31(on doing a websearch no documentation comes pertaining to this error).Also the debugger shows - connect : Parameter "p_to_object" is null'

The game node is accessed using :-

var game = get_tree().get_root().find_node("game")

Code syntax (player script) -

self.connect("self_signal_name" , target_object_path/target_object_name,"method_in_target_script",[packedScene,var1,var2 ...etc],1)  

Also used (player script) -

player_node_path.connect("self_signal_name" , target_object_path/target_object_name,"method_in_target_script",[packedScene,var1,var2 ...etc],1)

Even on checking for different ConnectFlags ,the above error persists

The bug mentions something about referencing a higher class, and having a const in there, too. Do you use classes, or have a const in one of your scripts?

Ertain | 2020-06-05 13:51

:bust_in_silhouette: Reply From: ferobregon

I had a similar issue, the “target_object_path/target_object_name” in my case was null at the time I was trying to connect.