unity3d – How do I fix an Invalid Expression Term ‘=’ error in Unity/C#?
Heyo, not very familiar with C#, much less Unity, and I’m apparently doing something wrong, here’s my code, THe only error I get is:
‘Invalid Expression Term “=”‘
bool currentlydown;
// further up the script
void Start() {
currentlydown = false;
}
// later up the script
void Update() {
if ((Input.GetKeyDown("W") || Input.GetKeyDown("A") || Input.GetKeyDown("S") || Input.GetKeyDown("D")) && currentlydown === false) {
anim.SetBool("Walking", true);
currentlydown = true;
} else if (!(Input.GetKeyDown("W") || Input.GetKeyDown("A") || Input.GetKeyDown("S") || Input.GetKeyDown("D")) && currentlydown === true){
anim.SetBool("Walking", false);
currentlydown = false;
}
}
Any and all help is appreciated!
Read more here: Source link