Godot version:
Godot 3.1.1.stable.mono.official
OS/device including version:
Windows 10
Issue description:
I created a script called "network.gd", I added a function called "create_server()" in it. Then I added it as a AutoLoaded script and tried to use it in another script. When I tried to run the project it showed me that error - "_Non-static function 'create_server' can only be called from an instance._" when AutoLoading a script"
Steps to reproduce:
func create_server():
# Initialize the networking system
var net = NetworkedMultiplayerENet.new()
# Try to create the server
if (net.create_server(server_info.used_port, server_info.max_players) != OK):
print("Failed to create server")
return
# Assign it into the tree
get_tree().set_network_peer(net)
network.create_server() from another scriptMinimal reproduction project:
SimpleNetworkingPractice.zip
This is because you used class_name with the same name as Autoload. It's the same as #28187
Yes, that was the case. Thanks :)
Most helpful comment
This is because you used
class_namewith the same name as Autoload. It's the same as #28187