How to make a loading bar screen in unity using photon fusion? using asyncoperation.

Sparasad
Sparasad
edited March 2023 in Fusion

  IEnumerator LoadLevelAsync(NetworkRunner runner, PlayerRef player)

   {


    AsyncOperation operation = runner.SetActiveScene(2);


    while (!operation.isDone)

    {

       float progressValue = Mathf.Clamp01(operation.progress / 0.9f);

        loadimagefill.fillAmount = progressValue;

       percentage.text = Mathf.Round(progressValue * 100f) + "%";


       yield return new WaitForEndOfFrame();

    }



   }





this is my code...

when I'm adding (AsyncOperation operation = runner.SetActiveScene(2);) its shows like cannot convert void to unity engine async operation.

Answers