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?
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.
Use non kinematics rigidbody colliders with all constraints freezed. Then use OnCollisionEnter to get the contact points.
Thank you in advance!