0 votes

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

in Engine by (51 points)
edited by

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?

1 Answer

0 votes

I had a similar issue, the "targetobjectpath/targetobjectname" in my case was null at the time I was trying to connect.

by (67 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.