How to fix this error

I am trying my hand at a 2d sidescroller game and am trying to implement a health system. I was making my player’s health return after death and this error came up.

Assets/Scripts/LevelManager.cs(58,41): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

line 58 in my LevelManager script is…healthManager.FullHealth;

Can anyone please help so I can continue, Thanks!

If “FullHealth” is a property you have to assign it’s value to another variable (and the “get” will be called) or assign a value to it (“set” will be called). Just writing “healthManager.FullHealth” doesn’t mean anything.

It looks like you meant to invoke a method.


This implies that, on whatever type of object healthManager is, there is a method like this:

void FullHealth() {
// set health to full here