Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

Get URL from Unity Web Request

$
0
0
Hi all! My friend and I are currently working creating a game expanding on the Wikipedia Game. I'm currently working on setting the target page you have to get to in order to win. Luckly, wikipedia has a nifty URL we can use to open up a random page.However, I'm having trouble finding out how to get the url of that page. This is what I have so far: private void Start() { string randomLink = "https://en.wikipedia.org/wiki/Special:Random"; StartCoroutine(getTarget(randomLink)); } private IEnumerator getTarget(string url) { using (UnityWebRequest getTargetURL = UnityWebRequest.Get(url)) { yield return getTargetURL.SendWebRequest(); if (getTargetURL.isNetworkError || getTargetURL.isHttpError) { Debug.LogError(getTargetURL.error); } else { target = //New URL } } } Thanks for your time!

Viewing all articles
Browse latest Browse all 387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>