Godot Version
4.3
Question
Hello,
I am trying to have a menu where a player could decide to host or join.
Quitting back to the menu and connecting back gets me this error :
<C++ Error> Parameter "host" is null.
<C++ Source> modules/enet/enet_connection.cpp:318 @ _create()
...
I wrote this small node for testing and getting the same error:
using Godot;
public partial class Test : Node
{
public override void _Ready()
{
base._Ready();
Host();
Quit();
Host();
}
public void Host()
{
Multiplayer.MultiplayerPeer = null;
var _peer = new ENetMultiplayerPeer();
var error = _peer.CreateServer(1234);
if (error != Error.Ok)
{
return;
}
GD.Print("OK");
Multiplayer.MultiplayerPeer = _peer;
}
public void Quit()
{
Multiplayer.MultiplayerPeer = null;
}
}
I tried with calling Close on the MultiplayerPeer without success