Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ANARCK3L |
I exported my multiplayer project (which gave no errors in the editor) on Linux, but when I try and run the server it throws an error at me (Supplied MultiplayerPeer must be connecting or connected.
)
Here’s the relevant code: (I think this is where the problem is? It does say modules/multiplayer/scene_multiplayer.cpp:201
…)
extends Node3D
var Server : bool
func start(): var peer = ENetMultiplayerPeer.new() var ipAddress =
"[IP ADDRESS]" if Server:
multiplayer.peer_connected.connect($Spawner.new_player)
multiplayer.peer_disconnected.connect($Spawner.destroy_player)
peer.set_bind_ip(ipAddress) assert(peer.create_server([PORT]) == OK)
print("server created") else:
assert(peer.create_client(ipAddress, [PORT]) == OK)
multiplayer.set_multiplayer_peer(peer)```