CollisionFlags without character controller

I am making a platformish game and I want to make it from scratch, so I don’t want to use the character controller - also because the character needs to be heavily affected by physics. I am using a capsule collider. Is there a way to calculate where the collision took place (head, sides, legs)? How is it done in the character controller? Thanks!

Yes, you can tell the 3D coordinate that was hit. From the manual under Collision (script alphabetic reference), with contact being a variable of your choosing:

for (var contact : ConactPoint in collision.contacts) {
        print(contact.thisCollider.name + " hit " + contact.otherCollider.name);
        // Visualize the contact point
        Debug.DrawRay(contact.point, contact.normal, Color.white);
    }

You can use contact.point to get the coordinates that were hit. I think that’s in world space so you might have to use transform.InverseTransformPoint(contact.point) to get the local coords.

Then you can evaluate the point to decide where it was hit. Below a certain y might be legs, for instance.

You could also have multiple colliders, one for each leg, etc.

Thanks a lot Morgan, I haven’t noticed that entry in the manual. I’ll try this and see what I can make out of it.