#Unity is throwing an error but I dont know what's wrong with my code
1 messages · Page 1 of 1 (latest)
in the if statement type panelOn == false
or replace it with !panelOn
! before a bool means its the opposite
For explanation:
= is an assignment operator.
== is a comparison operator.
Note that misusing the assignment operator inside an if condition may not always cause a compiler error, as assignments return the value that was assigned.