Hi,
I’m trying to make a game using Photon PUN in Unity. I am following a tutorial where the following c# code is used in a script file called NetworkManager:
using System.Collections;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
//const string VERSION = "v.0.0.1";
void Start () {
PhotonNetwork.ConnectUsingSettings();
}
void OnJoinedLobby()
{
RoomOptions roomOptions = new RoomOptions();
roomOptions.IsVisible = false;
roomOptions.MaxPlayers = 4;
PhotonNetwork.JoinOrCreateRoom("Room1", roomOptions, TypedLobby.Default);
}
}
My problem is that I get an error saying that “RoomOptions” and “PhotonNetwork” do not exist. I can solve the problem by declaring “using Photon.Realtime” and “using Photon.Pun”, which is fine but it makes me wonder if I have installed PUN incorrectly in Unity because in the tutorial I am following it appears you don’t have to do this (and the same seems to be true in code examples I find in the official documentation. Another difference is that ConnectUsingSettings should require a string argument but when I use it, it says it requires no arguments so I have had to remove the VERSION string.
Thanks in advance for any help.