- Home /
BCE0044: expecting error
got a few errors and I'm confused on how to fix them, any help will be much appreciated.
function playerstatecontoller()
{
If ((Input.GetAxis("Vertical") !=0 || Input.GetAxis("horizontal") !=0))
{
If (Input.Getbutton("Sprint"))
{
playerstate == 2;
}
//Line below it says that it was expecting }, found 'else'
else
{
//Line below expecting :, found ';'
playerstate == 1;
}
else
{
playerstate == 0;
}
}
}
Comment
Answer by sparkzbarca · Jan 24, 2013 at 09:22 PM
1 "=" not 2
x = y;
x is set to the value of y its value changes.
x == y
x is compared against y the value of x doesnt change
Do what sparkzbarca said and replace the ==
with =
Your answer
![](https://koobas.hobune.stream/wayback/20220613091532im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What is wrong with these two lines of scripting? 1 Answer
I need help with an error 1 Answer
Stomp Script 1 Answer
error help 2 Answers
Coding Issue 1 Answer