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 -
false
- a
PlayerMovement
, so you can't assign
false
to the variable
playerMovement
- 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
PlayerMovement
class to false:
playerMovement.MyBoolProperty = false;
But in this specific case that will give you another error - a
null reference
exception at run time because you don't assign any value to the
playerMovement
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
PlayerMovement
class by using the
new
keyword and assign it to the variable. The simplest way is like this:
public PlayerMovement playerMovement = new PlayerMovement();
.