Hello guys I was trying to calculating the damage that the player would receive although if defense value is different from 0 the result will always be 0, i know I must be missing something but i cant figure out why, can anyone help?
I’ve tried to round it , to cast it as either float and double but couldn’t fix it.
Thanks in advance.
Code:
float healthToLose = (damage * (100 / (100 + defense)));
health -= (int)Mathf.Round(healthToLose);