# UnityWebRequest won't work unless a breakpoint is triggered before hand

public void GetLeaderBoard() //Load all game data
{   UnityWebRequest myWr = UnityWebRequest.Get(Url(false));
myWr.SendWebRequest();
MonoBehaviour.print(text);
return;
}


text is populated by an empty string unless I stop at a break point before I encounter it. The MVC application that's giving me the data is being debugged on a separate solution, also it's going through something called IIS Express, which like runs it or something. My best guess is that something on my other application doesn't have enough time to send the data unless I stop execution with a breakpoint; however, this doesn't make any sense as myWr.downloadHandler.text is actually being populated with the data (according to the watch I have on, when it stops at the breakpoint on the return), so my other app should be out of the picture at this point.

Edit: So I got it working apparently the whole function needed to be part of a coroutine like so:

public IEnumerator GetLeaderBoard() //Load all game data
{
using (UnityWebRequest myWr = UnityWebRequest.Get(Url(false)))
{   yield return myWr.SendWebRequest();
if (myWr.isNetworkError) MonoBehaviour.print("Recieved error: " + myWr.error);
else