Access variable from another script

So I’ve been making a 2d platformer game in Unity (c#) and I have a variable in my playerMovement script called “isDashing”, that I want to access in my healthManager script, so that the player would only take damage if the player isn’t dashing. Also both Scripts are on the same GameObject.
Code Snippet from playerMovement:

public class Move : MonoBehaviour
    {
        private bool isDashing;
    
        ....
    
    }

Code Snippet from healthManager:

public class health : MonoBehaviour
{
    private bool isDashing;
    void Awake()
    {
        isDashing = GameObject.FindObjectOfType<Move>().GetComponent<Move>().isDashing;
    }

The code didn’t return any errors, but it doesn’t do anything. I’ve already tried out th solutions of other posts, but no luck. I have just started using Unity so i would really apreciate your help.
Thanks in advance.

Change your Move script to this

public class Move : MonoBehaviour
{
   public bool isDashing;
     
   ....      
}

Then change your health script to this

 public class health : MonoBehaviour
 {
     private bool isDashing;
     void Awake()
     {
         //if your health script is attached on healthManager gameobject
         isDashing = GameObject.Find("healthManager").GetComponent<Move>().isDashing;
     }
}