- Home /
expecting :, found ;.
Hey guys. I'm trying to make a basic Metroid/Contra style side-scrolling shooter. Things are going great for the most part, but I'm having a few issues making my character turn. I've been messing around with the top answer in this post and have run into the error above.
Here is the code that is giving the error:
function Update ()
{
if (transform.eulerAngles.y == 180);
{
turning = true;
}
else if (transform.eulerAngles.y == -180);
{
turning = false;
}
}
The line the error is directing me to is "turning = true;" but there's no error for "turning = false;" which is what is confusing me. I'm basing this part of the code on some of my enemy ai functions(which I had help with), which work perfectly with no errors, so I have no clue what the issue is, unless the eulerAngles have something to do with it. Also, I'd like to apologize for the godaweful formatting job I did...
Answer by Landern · Nov 29, 2012 at 09:31 PM
you have a semi-colon on the end of your if, remove it.
if (transform.eulerAngles.y == 180);
to
if (transform.eulerAngles.y == 180)
EDIT: and on your else if statement
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
NullReferenceException problem 2 Answers
How to Fix Compilier Errors? 0 Answers
Need help on a semicolon error 1 Answer
Expressions in statements must only be executed for their side-effects. 1 Answer