That is caused by the following statement
facingRight != facingRight;
!=
is an inequality operator. It returns true if both sides are unequal, and false if both sides are equal. Its counterpart would be the ==
operator.
What you most likely meant to do there is
facingRight = !facingRight;
This sets facingRight
to be whatever is on the right-hand side. Which is !facingRight
, which of course causes facingRight to become true if it is currently false, or false if it's currently true.
P.s. you generally might want to include on which line the error occurs. Unity should tell you about that.