This is my code:
if (clientWorld != null)
{
IPAddress serverAddress = IPAddress.Parse(_ip);
NativeArray<byte> nativeArrayAddress = new NativeArray<byte>(serverAddress.GetAddressBytes().Length, Allocator.Temp);
nativeArrayAddress.CopyFrom(serverAddress.GetAddressBytes());
NetworkEndpoint endpoint = NetworkEndpoint.AnyIpv4;
endpoint.SetRawAddressBytes(nativeArrayAddress);
endpoint.Port = _port;
using var query = clientWorld.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
query.GetSingletonRW<NetworkStreamDriver>().ValueRW.Connect(clientWorld.EntityManager, endpoint);
}
The code is trowing the error: “Too many NetworkDriver created for the client. Only one NetworkDriver instance should exist”
I understand there is too many drivers, but i can’t figure out where the driver is created. I all do is create the world and try to connect.
Any tips on how to debug this one?