Script error, cannot fix whatsoever!
Hi there, I asked a question earlier today about browsers and working in a game, but I received an answer! (Thanks to the guy who helped a lot!~) But I have an issue with it. It gives me an error that I cannot fix. And when I do, it just gives me the same error. If somebody can help, it's a life saver!
switch (inputField.text.ToLower())
{
case "www.blahblah.saq":
// do something when they hit up www.blahblah.saq
break;
case "www.microsoft.com":
// do something else based off the www.microsoft.com URL
break;
default:
// load up the browser image for any "WRONG" URL's
}
It gives me this error,
Answer by SarperS · Aug 11, 2016 at 01:46 AM
You forgot a break
after the default
case.
default:
break;
Alright, It gives me that error, which I can fix! And I did. But then it just keeps giving me the error "Unexpected token . "
Which nothing seems to be there. Ah', Unity is absolutely weird when it comes to scripting.
You've added 2 break statements after the first case. There should be one. And you are still missing a break statement after the default case.
I've already commented the corrected version of your original code block.
I saw, apparently it didn't send until after, sorry bout' that! D: Let me check sir, sorry..~
Alright, got it! Dude, you have no idea how much this has been stumping me, thank you so much! :D
Your answer
Follow this Question
Related Questions
Getting error on lap counter script JS 0 Answers
ScriptingProblems - Open door with 3 keys 1 Answer
Enemy AI for Shooting Game 1 Answer
Translate C# into Javascript 0 Answers
Why do I keep getting this error? 1 Answer