Hello all,
Hope anyone can help me with this. I’m trying to set up PUN2, but in my existing project, it won’t connect.
I went as far as removing all plugins, packages, scripts, assets resources etc. until I ended up with an empty project, with the Connect to Photon script attached to my main camera. Here’s the code:
using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NetworkController : MonoBehaviourPunCallbacks
{
// Start is called before the first frame update
void Start()
{
Debug.Log("Connecting to Photon Network");
PhotonNetwork.ConnectUsingSettings(); //2
}
public override void OnConnectedToMaster()
{
Debug.Log("We're now connected to the " + PhotonNetwork.CloudRegion + " server!");
}
}
It never connects. When enabling full logging, this is the output in console:
Connecting to Photon Network
UnityEngine.Debug:Log(Object)
Connect()
UnityEngine.Debug:Log(Object)
SocketUdp, .Net, Unity.
UnityEngine.Debug:Log(Object)
IPhotonSocket.Connect() ns.exitgames.com:5058 this.Protocol: Udp
UnityEngine.Debug:Log(Object)
I cannot wrap my head around this issue. When I create a new project, and install PUN2 on the exact same way, and add the script above, it works directly; It connects to the region server.
I’ve went through any possible setting I could think of, up to the player settings and preferences, mimicking each setting. I’m stunned.
Does anyone know why this is happening? Is there a way to get more indepth debug logging to figure out why it refuses to connect?
I also made a thread on photonengine.com, but thusfar, no replies:
The Photon Forum is Closed Permanently. | Photon Engine
Hopefully someone is able to shed some light on this.
Many thanks in advance!