below you can see my code i have wrote .
public static float doAttack(float attackPower, float healthPool)
{
Debug.Log("this is working but not not taking health off????");
healthPool -= attackPower * Time.deltaTime;
//health -= 500 * Time.deltaTime;
return (healthPool);
}
and here is where i call it from.
void OnTriggerEnter2D(Collider2D other)
{
attack.doAttack(attackForce, health);
}
as you can I pass in my variable but dont seem to get the return since the health doesnt decrease can anyone put out where i am going wrong.