Hi,
@Painder: I tried to switch to udp, but sadly that also didn’t work out for me…
@Marc_Carlyon: Here is my ClientGameManager.cs :
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Unity.Netcode.Transports.UTP;
using Unity.Netcode;
using Unity.Networking.Transport.Relay;
using Unity.Services.Core;
using Unity.Services.Relay;
using Unity.Services.Relay.Models;
using UnityEngine;
using UnityEngine.SceneManagement;
public class ClientGameManager
{
private const string MenuSceneName = "Menu";
private JoinAllocation allocation;
public async Task<bool> InitAsync()
{
await UnityServices.InitializeAsync();
AuthState authState = await AuthenticationWrapper.DoAuth();
if(authState == AuthState.Authenticated)
{
return true;
}
return false;
}
public void GoToMenu()
{
SceneManager.LoadScene(MenuSceneName);
}
public async Task StartClientAsync(string joinCode)
{
try
{
allocation = await Relay.Instance.JoinAllocationAsync(joinCode);
}
catch (Exception ex)
{
Debug.Log(ex);
return;
}
UnityTransport transport = NetworkManager.Singleton.GetComponent<UnityTransport>();
RelayServerData relayServerData = new RelayServerData(allocation, "dtls");
transport.SetRelayServerData(relayServerData);
NetworkManager.Singleton.StartClient();
}
}
I’m using Unity 2022.3.4f1 and all of the packages are up to date.
Thank you both for your help.
Best regards,
Manuel