- Home /
Unexpected Token: if
Hi, im new to unity and scripting so maybe the answer is simple...
But im getting an error: Unexpected token: if Please someone help me with this error... i tried everything...
{
void :
if(Input.GetButtonDown("FlashDown")){
Transform.Y == -0.5;
Transform.Y = 1.0
else;
Transform.Y = 1.0;
Transform.Y = 0.5
}
I think you hit a new record on "the most syntax errors in the smallest script".
It's not even clear what language you (tried to) use...
@siebevelez01 - please don't post essentially the same question twice. As @Bunny83 indicates, there are a lot of problems with this script. I offered a fixed version yesterday:
http://answers.unity3d.com/questions/471640/error-cs8025.html
Answer by waskar · Jun 10, 2013 at 03:45 PM
try ``if(Input.GetButtonDown("FlashDown")){
Transform.Y == -0.5; Transform.Y = 1.0 } else{
Transform.Y = 1.0; Transform.Y = 0.5 }`` it should work
Answer by Mukabr · Jun 10, 2013 at 03:46 PM
how about
if(Input.GetButtonDown("FlashDown"))
{
Transform.y = -0.5f;
Transform.y = 1.0f;
}else{
Transform.y = 1.0f;
Transform.y = 0.5f;
}
Your answer
Follow this Question
Related Questions
unexpected Token error 1 Answer
Unexpected Token 3 Answers
Light Switching Unexpected Token Error 1 Answer
Help me with this Unexpected token error 1 Answer
Please help, syntax error woe 2 Answers