GOT NULL REFERENCE ERROR Launcher.InformGameManager (System.Int32 actorNumber)

23 Views Asked by At
   [PunRPC]
    public void InformGameManager(int actorNumber) 
    {
        // Get the player's role and spawn point and inform GameManager
        Player player = PhotonNetwork.CurrentRoom.GetPlayer(actorNumber);
        string assignedRole = GameManager.Instance.GetRandomRole(0);
        Vector3 spawnPoint = GameManager.Instance.GetRandomSpawnPoint();// HERE IS THE ERROR
        photonView.RPC("AssignRole", RpcTarget.AllBuffered, actorNumber, assignedRole, spawnPoint);
        
    }

NullReferenceException: Object reference not set to an instance of an object Launcher.InformGameManager (System.Int32 actorNumber) (at Assets/Resources/Launcher.cs:189)

0

There are 0 best solutions below