Commit d7ce9d10 authored by DUMOULIN ANTOINE's avatar DUMOULIN ANTOINE
Browse files

Merge branch 'bugfix/clampDamage' into 'develop'

fix damage

See merge request fauchezlegouic/projet-integrateur!416
parents 2acb02c7 4aec2201
......@@ -109,7 +109,7 @@ public class CollisionManager : MonoBehaviour
}
//See if we hit another player
VehicleBase other = collision.transform.root.GetComponent<VehicleBase>();
VehicleBase other = hitCollider.transform.root.GetComponent<VehicleBase>();
//Calculate the damage using a multiplier depending on which side of the car is hit
Vector3 dot = (other.transform.position - transform.position);
float dotProduct = Vector3.Dot(dot.normalized, transform.right);
......@@ -173,7 +173,7 @@ public class CollisionManager : MonoBehaviour
Debug.Log(isPlayer + directionDiff);*/
int damage = (int)((masse * rapportVit) / 100 * randDamage);
//Debug.Log(isPlayer + "Damage : " + damage);
return damage;
return Mathf.Clamp(damage, 0, 50);
}
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment