I use following code for a damage calculation all with floats:
var Off_To_Def_Hits: float = Mathf.Ceil((OffForce - DefForce) / ((DefAgility * Defsize) / 2));
I used print to check the calculation. It say in this case:
print("DmgCalc.: " + "DmgDiff: " + ((OffForce - DefForce)) + ", / Dodging= " + ((DefAgility * Defsize) / 2) + " Raw.OffToDefHits: " + Off_To_Def_Hits);
Mathf.Ceil((117f - 48f) / 6f) = 5
![alt text][1]
But I expected 12! Wheres the problem??
[1]: /storage/temp/75993-dmgcalcfail.jpg
↧