So I was following tutorials from “Christian Richards - YouTube” when I got stuck at his “Intro To Photon 3.0 - Creating our client” video Intro To Photon 3.0 - Creating our client - YouTube where whenever I click the “Connect” button in the “Login” Scene the status just stays at disconnected. I’ve looked over the video and started over from scratch more than 6six during the last 5days but still doesn’t seem to work. I think the problem might be this line in the code I’ll provide. Due to it having a green wavy line under it in Visual Studo
PhotonPeer peer = new PhotonPeer(_photonServer, false);
Whole code
using UnityEngine;
using System.Collections;
using System;
using ExitGames.Client.Photon;
public class Login : MonoBehaviour
{
private PhotonServer _photonServer;
private bool connected = false;
// Use this for initialization
void Start()
{
Application.runInBackground = true;
_photonServer = new PhotonServer();
}
// Update is called once per frame
void Update()
{
try
{
if (connected)
{
_photonServer.Update();
}
}
catch (Exception e)
{
Debug.Log(e);
}
}
public void OnApplicationQuit()
{
try
{
_photonServer.Disconnect();
}
catch (Exception e)
{
Debug.Log(e);
}
}
public void OnGUI()
{
if (GUI.Button(new Rect(100, 60, 100, 30), "Connect"))
{
PhotonPeer peer = new PhotonPeer(_photonServer, false);
_photonServer.Initialize(peer, "local host:5055", "PhotonIntro");
connected = true;
}
GUI.Label(new Rect(100, 100, 200, 300), _photonServer.Status);
}
}