There are a number of problems here - one of which Richard has described.
The error message is saying that it can't convert a bool value -
, so you can't assign
to the variable
- in the same way as you can't put a car into a coffee cup: they are unrelated items, and just don't fit together!
Probably, what you wanted to do was set a property of the
class to false:
playerMovement.MyBoolProperty = false;
But in this specific case that will give you another error - a
exception at run time because you don't assign any value to the
variable, all you do is declare it:
public PlayerMovement playerMovement;
Somewhere in your code for that class, you need to create an instance of the
class by using the
keyword and assign it to the variable. The simplest way is like this:
public PlayerMovement playerMovement = new PlayerMovement();