Trying to Invoke method playerHealth.Damage?

So I’m getting use to c# and am still learning the language and I’ve come to a problem where a health bar I created won’t scale but flashes every time he takes a hit and I know damage is still received. Here is my code for context. P.S I tried adapting the code from a tutorial I watched:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class PlayerHealth : MonoBehaviour
{
public int maxPlayerHealth;
public int playerHealth;
public GameObject healthBar;

void Start () //set health
{
	playerHealth = maxPlayerHealth;
	InvokeRepeating ("Damage", 1f, 1f);
}

void Update () 
{
	if (playerHealth <= 0) 
	{
		Destroy (gameObject); //destroys character

	}

}

public void Damage (int dmg) // calculates what percentage of health he is at
{
	playerHealth -= dmg;
	int calcHealth = playerHealth / maxPlayerHealth;
	setHealthBar (calcHealth);

} 

public void setHealthBar (float myHealth) //set the size of the bar
{
	healthBar.transform.localScale = new Vector3(Mathf.Clamp(myHealth, 0f, 1f), healthBar.transform.localScale.y, healthBar.transform.localScale.z);
}

}

This line is the problem…

int calcHealth = playerHealth / maxPlayerHealth;    

You’re doing a floating point division and then assigning the result to an integer variable. An integer can only hold integer values, so you end up with 0, 1, 2, etc. But the health value needs to have values between 0 and 1 since it’s used as the percentage of health.

Notice how setHealthBar accepts a floating point variable. If you change the data type of calcHealth to a float you should be fine.