Search Unity

Resources.LoadAsync() bugged?

Discussion in 'Scripting' started by uiniti, May 7, 2015.

  1. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    Resource.LoadAsync() doesn't seem to work in Unity 5 but using the same files, Resources.Load() does.

    Code (JavaScript):
    1.     var request = Resources.LoadAsync("Audio/"+n);                  
    2.    
    3.     while (!request.isDone){
    4.         Debug.Log("LOAD ASYNC: " + request.progress +"  Audio/"+n);
    5.         yield;
    6.     }
    7.        
    8.     var audioClipLoaded = request.asset as AudioClip;
    audioClipLoaded is null when using LoadAsync but it's ok when using Load().

    Why?
     
  2. DragonSix

    DragonSix

    Joined:
    Jul 2, 2013
    Posts:
    37
    I'd like to know what's up there too, it seems to not load anything. There is not any form of error when LoadAsync fails either.
     
    uiniti likes this.
  3. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    Which Unity version are you on?
     
  4. bruster

    bruster

    Joined:
    Oct 1, 2013
    Posts:
    3
    Same with me....

    Unity Version: 5.3.4f1
     
  5. DragonSix

    DragonSix

    Joined:
    Jul 2, 2013
    Posts:
    37
    Except it works now Bruster. You should check your code.