Staged bullet damage?

When my player shoots at enemies I want them to cause more damage the closer to the enemy’s center they hit, and less damage if it’s out to the sides. Right now though, my script simply checks if their bullets hit their character controller. How could I accomplish a different amount of damage depending on where it hits?

Here is something that might help you in a good direction. Note “center” can mean several things, pivot, center mass, center as the character is bisected. This code uses the pivot point. Because the pivot is (likely) inside the mesh, it will never score the maximum points.

#pragma strict
var maxDist = 1.0;
var minPoints = 10.0;
var maxPoints = 80.0;

function OnColliderEnter(col : Collision) {

   if (col.collider.tag == "Bullet") {
        var dist = (transform.position - col.contacts[0].point).magnitude;
        var points = (maxDist - dist)/maxDist * maxPoints;
        points = Mathf.Clamp(points, minPoints, maxPoints);