Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Detecting weapon hit with collider

Discussion in 'Physics' started by VincentAbert, Jun 6, 2020.

  1. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello everyone,

    I'm a beginner so this might be a stupid question, but I'm really wondering : is it fine to use a box collider on sword's blade to detect wether an enemy was hit ? It works fine, but having no experience I'm always wondering wether my solutions are bad practice, or too expensive...
    As far as I can tell, it's the only way if I want to instantiate an impact effect at the right place, as well as trigger a sound effect at the right time.

    The reason I have doubts is that the default physics settings in unity don't allow two kinematics rigidbodies to detect collision, so I'm wondering if there's a reason...

    Thanks a lot !