Received RPC "" for viewID 1 but this PhotonView does not exist!

Options
Tamoo
Tamoo
Hey guys,

I know this question got asked a lot, but most errors with the same error message occured, when den RPC was called to early and the PhotonView did not exist at the point, which is not the problem with my code.

But in my first try at PUN and Multiplayer stuff, i want to have a lobby system with 2 teams, and everytime one person in the lobby decides to join a team (you are not assigned a team by default) i want everybody to know and a list of all the players in each team to reload and show the new join player. Players are also able to leave the team.

First I tried it with the Stream, but that was kinda overkill to have this much traffic, so i am trying myself now with RPCs, where everytime someones joins or leaves a team a rpc with the name, the team, and if he joind or left the team will be sent (i know not optimal but if i buffer them they may do the job just fine for now). If there is a smarter way of doing that feel free to tell me (maybe there is just 1 photonview and everybody sees the same list or something idk).

The error code says:
Received RPC "ReloadLists" for viewID 1 but this PhotonView does not exist! Was remote PV. Remote called. By: #01 'player' Maybe GO was destroyed but RPC not cleaned up.

And the biggest Problem is: I have no idea where the viewId 1 comes from, if i try it with 2 Players, the have the Photonview 1001 and 2001.

The Code looks like follows:
everytime someone joins, a new TeamManager gets instatiated which has a photonview attached to it
void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		if (scene.buildIndex == 1) // We're in the game scene
		{
			PhotonNetwork.Instantiate("TeamManager", Vector3.zero, Quaternion.identity);
		}
	}
if we press on the join button for the first team, this snippet in TeamManger gets called:
team1List.Add(PhotonNetwork.NickName);
if (photonView.IsMine)
    photonView.RPC("ReloadLists", RpcTarget.All, PhotonNetwork.NickName, true, true);

the RPC looks like this:
[PunRPC]
public void ReloadLists(string name, bool team1, bool add)
{
    if (team1)
    {
        if (add)
            team1List.Add(name);
        else
            team1List.Remove(name);
    }
ReloadTexts();
Reload Texts() simply writes the names in the textfields.

Thanks for reading through it, I am completly lost with Multiplayercoding but really wanna learn and improve it.

Much love