Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: caesarhernandez on May 20, 2015, 07:52:53 PM

Title: StartCoroutine and WWW[SOLVED]
Post by: caesarhernandez on May 20, 2015, 07:52:53 PM
Hello,

Unity seems to be locking up when I use the StartCoroutine action and a GameObject with a script attached using an IEnumerator return type. Basically I'm trying to use StartCoroutine to download a scene bundle. I have a game object with a script called BundleMasterScript.cs with a download method like this:

Code: [Select]
    public IEnumerator DoTheDownload()
    {
        Caching.CleanCache();
        var download = new WWW("http://[some website].com/am_web/bundles/Android/version5scene5.txt");
        yield return download;
        var bundle = download.assetBundle;
        Application.LoadLevel("scene5");
    }

Then I use the StartCoroutine action to invoke the method - see attached image. (The action after the StartCoroutine is empty.)

Unity always locks up and I do not understand where or why it is happening - so I'm starting in Playmaker forum since this is my implementation. Is there something else I need to do here? I'm using Unity 4.6 and a relatively recent version of Playmaker (I think I updated it about 3 months ago)

Title: Re: StartCoroutine and WWW
Post by: caesarhernandez on May 20, 2015, 07:54:42 PM
This used to work BTW...the site is definitely accessible and the bundles are built correctly; it just suddenly stopped working a couple of days ago and I'm struggling to figure out why or where I should start to debug this.

thanks
Title: Re: StartCoroutine and WWW
Post by: caesarhernandez on May 20, 2015, 08:14:35 PM
Ok the issue seems to be when I try to do the Application.LoadLevel("scene5"); I commented it out and it does not freeze any longer. I suspect the problem is in "scene5"
Title: Re: StartCoroutine and WWW
Post by: caesarhernandez on May 20, 2015, 08:19:26 PM
Ok I figured it out - the problem was in the scene5 that I was trying to load.