H
H
Herman Coffman2022-03-30 20:44:59
Unity
Herman Coffman, 2022-03-30 20:44:59

Why can't 2 Photon libraries run at the same time in the same script?

Can't connect libraries using Photon.Pun; and using Photon.Realtime; at the same time. The wrong library didn't work at first, but I made one of the libraries work with File -> Move Script to -> "Library Name". But only one of the libraries works this way. How to make 2 libraries work at the same time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-04-01
@vabka

Most likely, you somehow inattentively watched the lesson according to which you are doing the assignment.
I just specifically installed Unity and tried it on your own video
1. Install this: https://assetstore.unity.com/packages/tools/networ... by clicking on Add to My Assets -> Open In Unity
2. Import this , using the Import button.
3. Create a script in the Assets folder with the following content:

using Photon.Pun;
using UnityEngine.UI;
using Photon.Realtime;


public class MenuManager : MonoBehaviourPunCallbacks
{
    public InputField createInput;
    public InputField joinInput;

    public void createRoom()
    {
        RoomOptions roomOptions = new RoomOptions();
        roomOptions.MaxPlayers = 6;
        PhotonNetwork.CreateRoom(createInput.text, roomOptions);
    }
        
    public void joinRoom()
    {
        PhotonNetwork.JoinRoom(joinInput.text);    
    }

    public override void OnJoinedRoom()
    {
        PhotonNetwork.LoadLevel("Game");
    }
}

There are no errors about a non-existent namespace.
but I got one of the libraries to work with File -> Move Script to -> "Library Name".

If it worked for you only after that, then you somehow installed it crookedly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question