PhotonTeamsManager Showing 0 player in that team although there is some player

Options

I have check wheather below code is working correctly or not by last Debug line and I found that player.length is always 0 althougth there are some player in that team

1 How can I implement it corrcly ?

2 What Mistake I have done here?


public bool CanJoin(PhotonTeam newTeam)
    {
        Debug.Log(_teamSize + " is Team Size");
        bool canJoin = false;
        Player[] players = null;
        if (PhotonTeamsManager.Instance.TryGetTeamMembers(newTeam.Code, out players))
        {
            if (players.Length < _teamSize)
            {
                canJoin = true;
            }
            else
            {
                Debug.Log($"{newTeam.Name} is full");
            }
            Debug.Log(newTeam.Code+" "+newTeam.Name+" "+""+_teamSize+" "+players.Length +" is Player Length" + canJoin);
        }
        return canJoin;
    }

Answers

  • Tobias
    Options

    This is hard to guess. The code that actually would set and fill the teams is not known.

    We can't debug this for you (so no use posting all that code), sorry. You have to debug this up to a point where it becomes a question how PUN works or how to do things differently. We can't check your project for you and this is not a known issue.