- Home /
Scene Management not working from a WWW.text value
Here's a strange one:
I'm looking to load a new scene when the results come back from a php login script. For whatever reason, the new scene is not loading when I run it.
Debug.Log (www.text);
if(www.text=="You are logged in")
{
SceneManager.LoadScene ("UserMenu");
}
else if(www.text=="Wrong Username or Password!")
{
Debug.Log ("Wrong Username or Password");
}
else if (www.text=="User Not Found!")
{
Debug.Log ("Your Credentials Were Not Found. Please Contact Your Administrator.");
}
The last two actually work, it's the login success that does not. Anyone have some insight? Thanks!
Just a quick sanity check, the string returned by the www.text is exactly "You are logged in" with no punctuation or anything, right? It's just, the other two have an exclamation point, and I want to be sure, haha. Likewise, check the scene in the BuildSettings to make absolutely sure that it's called exactly "User$$anonymous$$enu".
You could also put a Debug.Log within that first if
section, so you know which of the two things $$anonymous$$arshallN alludes to is likely to be the issue: the string or the scene.
Something to try: try loading that scene using the exact same code but just when you press a key:
(Untested code) void Update() { if (Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.L)){ Scene$$anonymous$$anager.LoadScene(“whateverscenename”); } }