Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question Part of the code below cannot be type-converted by the method of reading the next scene asynchronous

Discussion in 'Multiplayer' started by neccopen, Sep 15, 2022.

  1. neccopen


    May 4, 2020
    I am using Pun2.
    I am writing a program that asynchronously transitions scenes (rooms).
    at the moment, so far

    Code (CSharp):
    1. privateAsyncOperation_async;
    2. _async = SceneManager.LoadSceneAsync(SceneName);
    3. _async.allowSceneActivation = false;
    4. _async.allowSceneActivation = true;
    I was able to do it with the above process,
    With asynchronous loading when connecting to PhotonNetWork,
    _async = PhotonNetwork.LoadLevel(scene name);
    When I change it as above, I get the below error

    error CS0029 cannot implicitly convert type 'void' to 'UnityEngine.AsyncOperation'

    The question is, in addition to how to resolve the above error (type conversion),
    Can PhotonNetWork load next scene asynchronously before scene transition?[/code]