- Home /
PUN cancels an ongoing async level load
I have a code that is supposed to send me to the next scene , except it gives me the error PUN cancels an ongoing async level load , as another scene should be loaded , Next scene to load: 3 , and there is no other scene that should be loades as far as i know , i even tried to make the game all over again a bit more refined but the same bug comes back to me
using Photon.Pun; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class StartButton : MonoBehaviour { public GameObject Dice; PhotonView pv; public int[] Gamer; int n;
// Start is called before the first frame update void Start() { PhotonNetwork.AutomaticallySyncScene = true; pv = gameObject.GetComponent(); if (PhotonNetwork.IsMasterClient) { gameObject.GetComponent().enabled = true;
} else { gameObject.GetComponent().enabled = false; }
}
public void Starter() {
pv.RPC("Started", RpcTarget.All); }
[PunRPC] public void Started() { for (int i = 0; i < Dice.GetComponent().AmountOfGames; i++) {
Dice.GetComponent().Diced(); n = Random.Range(0, Gamer.Length);
if (PhotonNetwork.IsMasterClient) { if(n == 0) {
PhotonNetwork.LoadLevel(3); }
} else { return; }
}
} } ,I have a code that is supposed to send me to the next scene , except it gives me the error PUN cancels an ongoing async level load , as another scene should be loaded , Next scene to load: 3 , and there is no other scene that should be loades as far as i know , i even tried to make the game all over again a bit more refined but the same bug comes back to me (using Photon.Pun; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class StartButton : MonoBehaviour { public GameObject Dice; PhotonView pv; public int[] Gamer; int n;
// Start is called before the first frame update void Start() { PhotonNetwork.AutomaticallySyncScene = true; pv = gameObject.GetComponent(); if (PhotonNetwork.IsMasterClient) { gameObject.GetComponent().enabled = true;
} else { gameObject.GetComponent().enabled = false; }
}
public void Starter() {
pv.RPC("Started", RpcTarget.All); }
[PunRPC] public void Started() { for (int i = 0; i < Dice.GetComponent().AmountOfGames; i++) {
Dice.GetComponent().Diced(); n = Random.Range(0, Gamer.Length);
if (PhotonNetwork.IsMasterClient) { if(n == 0) {
PhotonNetwork.LoadLevel(3); }
} else { return; }
}
} } )