When my Android game is started, 3 images are loaded from the internet and are placed on planes like this: Code (csharp): private var image1: WWW; private var image2: WWW; private var image3: WWW; public var Images: GameObject[] function Start () { image1 = new WWW ("image1.png"); yield image1; Images[0].renderer.material.mainTexture = image1.texture; image2 = new WWW ("image2.png"); yield image2; Images[1].renderer.material.mainTexture = image2.texture; image3 = new WWW ("image3.png"); yield image3; Images[2].renderer.material.mainTexture = image3.texture; } This script is called loadingImages.js That's working fine. But if I call this function Start() from another script like this: Code (csharp): loadingImages.Start(); I get the error WWW is not ready downloading yet. Why is yield image1 etc. only working when the game is started but not when the function Start() is called from another script?
Start is called as a coroutine at the beginning of the game, so use StartCoroutine() to start it from other scripts.
I did it like this: otherscript.StartCoroutine("Start"); But it still says that WWW is not ready downloading yet. When I use application.loadlevel it's working fine but I don't want to start the whole game.
Hiya again! I haven't done much UnityScript, but calling Start like Code (csharp): StartCoroutine(otherscript.Start()); Should help!
It is still not working. It still says that WWW is not ready downloading yet. Maybe that it has something to do with Android. Why is "yield image1" not working? "isDone" is also not working. Pfff, I have a hard time.