Search Unity

Unity Completely Freeze during LoadLevelAsync

Discussion in 'Editor & General Support' started by CalaveraX, Jul 8, 2015.

  1. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    143
    Hi Everyone! I'm having some troubles with unity.

    i was working on a project made on unity 4, and our client need us to send the game with unity 5

    when we ported our game we faced a lot of bugs and troubles that we are working on, but one i dont seem to fix or find why its happening is a complete freeze on unity editor when i load a new scene.

    my code is the following:

    Code (CSharp):
    1. public class LoadGameplayAsync : MonoBehaviour {
    2.  
    3.     AsyncOperation gameplayLoading;
    4.  
    5.     // Use this for initialization
    6.     void Start () {
    7.         StartCoroutine("loadGameplay");
    8.         gameplayLoading.allowSceneActivation = true;
    9.     }
    10.  
    11.     IEnumerator loadGameplay()
    12.     {
    13.         gameplayLoading = Application.LoadLevelAsync("GamePlay Tokio");
    14.         gameplayLoading.allowSceneActivation = false;
    15.         yield return gameplayLoading;
    16.     }
    17. }

    After this Load Async, unity stop responding and i have to kill the proces.

    Note: This happens randomly, sometimes it freeze, some times it load normally.

    Any hints on this would be really appreciated!

    Extra Details: This script is attached to the main camera on an empty scene, that contains a canvas and a simple "loading animation"
     
    Last edited: Jul 8, 2015