Question by
MauriceGer · Aug 03, 2018 at 08:09 AM ·
unityeditorprogrammingwebrequest
UnityWebRequest does not work on HoloLens
Hi, I want to download a txt-file from a Server. So here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class DownloaderScript : MonoBehaviour {
public void GetFile()
{
StartCoroutine(Check());
}
private IEnumerator Check()
{
UnityWebRequest www = UnityWebRequest.Get("http://examplesite.com/example.txt");
yield return www.SendWebRequest();
if (www.error != null)
{
Debug.Log(www.error);
}
else
{
Debug.Log(www.downloadHandler.text);
}
}
}
It works perfectly on the Unity Editor, but not on the HoloLens Emulator. "InternetClient" is activated in the PlayerSettings and I also tried to set www.chunkedTransfer = false. Did anyone had the same issue?
Comment
Best Answer
Answer by MauriceGer · Aug 03, 2018 at 09:17 AM
Edit: I updated Unity and it worked. So it was a Bug.
Your answer
Follow this Question
Related Questions
UnityWebRequest.Post Returning Empty String 0 Answers
HttpWebRequest doesn't work with Hololens 0 Answers
How to rotate object based on four vector3 points? 0 Answers
Stereo Sounds In 3D Space 1 Answer