How to call a certain function in an If Statement?

I have two classes (TankMovement & FollowPlayer). I want to use the ‘m_CurrentHealth’ from the TankMovement class to create an if statement in the update function of FollowPlayer. If I type in

if(pHealth.m_CurrentHealth), it gives me errors saying it can’t find it. How can I fix this?

an if statement evaluates boolean values. pHealth.m_CurrentHealth is a float value try something like: if(pHealth.m_CurrentHealth > 0)

also make sure to set the pHealth variable for example in your Start() Method:

public void Start(){
    pHealth = GetComponent<TankHealth>();
}

your class’ name is TankHealth, make sure the file name and the class name is the same if you use it as MonoBehaviour.

if your problem is not solved by this, plz specify:
is it an IDE/Compiler error, or a runtime error? and can you paste the error here!?