Hello all, I was wondering how to stream back php echos. In my php file i have a loop and inside the loop i have an echo("user processed"); back in unity i would like to display the echo("user processed") as its happening. Right now in my unity script i have Code (CSharp): IEnumerator ProccessUser(){ WWW w = new WWW(urlHost); yield return w; if(w.error != null) Debug.Log(w.error); else log.text = w.text.ToString(); } The issue with this is its waiting for the php to be finished running before i receive the echo. Is there a way to get it every time the echo happens?
WWW is obsolete, and the scripting reference says WWW.text returns an empty string if the page download is not yet complete. You could see if UnityWebRequest has the same limitation, since its DownloadHandler.text doesn't say it does. https://docs.unity3d.com/2019.1/Documentation/ScriptReference/Networking.DownloadHandler-text.html
I'm saying check to see if UnityWebRequest has the functionality you want, since I haven't tried it I can't say, but the documentation doesn't say it does not do what you want. WWW that you are using specifically says it does not do what you want, so you're wasting your time with the WWW class.