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