Argument Error in Unity Photon

0

I was developing an online project and I quoted the following function - PhotonNetwork.CreateRoom , and the following error occurred:

  

Assets / Scripts / Sindico.cs (53,31): error CS1501: No overload for method CreateRoom takes 0 arguments

You are asking for 4 arguments:

  • 1st Argument - string roomName
  • 2nd Argument - RoomOptions roomOptions
  • 3rd Argument - TypeLobby typeLobby
  • 4th Argument - Ainda nao sei!

How can I solve this problem?

    
asked by anonymous 12.10.2015 / 08:03

1 answer

0

It's been a while since you asked the question, but if anyone still has this question, you can check the answer.

First, you have to keep in mind that to create a room in Photon you need to be logged into the Lobby. If this has been done, you will then need to run the PhotonNetwork.CreateRoom () method.

The error you receive is because the method does not have a constructor that accepts its instantiation without method. And in fact, it does not need 4 arguments, you can create with just one: the room name

Ex: PhotonNetwork.CreateRoom ("my_sala");

Remembering that it automatically connects to the room when you create it. To find out if everything went well, you can use this method:

void OnJoinedRoom(){
    Debug.Log("Entrei na sala com sucesso!");
}

If you still have questions, take a look at this video covering the entire lobby section:

link

I hope I have helped. Hugs.

    
13.04.2016 / 23:51