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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

LoadLevelAsync Delay or Laging on Active?

Discussion in 'Scripting' started by longbottomup, Mar 25, 2015.

  1. longbottomup

    longbottomup

    Joined:
    Nov 2, 2013
    Posts:
    49
    I use AsyncOperation LoadLevelAsync for my loading scene.

    IEnumerator LoadingLevel() {
    async = Application.LoadLevelAsync("game");
    async.allowSceneActivation = false;
    yield return async;
    }

    But, when i active: async.allowSceneActivation = true;
    ...it's not smoothly, delay about two seconds to switch scene. Someone can tell me why? I want to it's active on 100%, not delay or screen freeze. Thank you.
     
  2. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    async.allowSceneActivation = true this needs to be after yield, in your IEnumerator, to activate scene after its fully loaded. If it still freezes, check ya friggin' profiler.
     
  3. longbottomup

    longbottomup

    Joined:
    Nov 2, 2013
    Posts:
    49
    What's the figgin' profiler?