What is the optimal way to get the hit point in a trigger collision?

Hello. I’m making a Hack & Slash game where I need to check every attack with triggers, because I control hit detection with animations and scripts. The thing is, that sometimes I want to check the hit position to create particles or for generating knockback direction. So I’m searching for the optimal solution without sacrificing performance to get that hit position.

What will be the most optimal?

  1. When the trigger (hitbox) detects a collider (hurtbox), use Physics.Boxcast/ Physics.CapsuleCast/ Physics.SphereCast using the size of the trigger to get a RaycastHit. Then check if RaycastHit.collider is the same as the Collider detected inside the OnTriggerEnter function, and return RaycasyHit.point.

  2. Use non kinematics rigidbody colliders with all constraints freezed. Then use OnCollisionEnter to get the contact points.

Thank you in advance!

The easiest way would probably be to use Collision.contacts. I don’t know if it’s the most efficient, but the array has already been generated for you.