Search Unity

Detect exact collider which triggers OnTrigger

Discussion in 'Physics' started by Elegarret, May 20, 2021.

  1. Elegarret

    Elegarret

    Joined:
    Feb 15, 2017
    Posts:
    18
    Hello community! I have just read a whole lot of posts about similar problems but none was helpful to me.

    I have a paddle and a water. Water is a big trigger collider with kinematic rigidbody attached. Paddle is a kinda long handle with two blades on both sides. Paddle is a root object with rigidbody and blades are children with colliders. What I want is to detect which blade touches the water.

    When I attach script with OnTrigger to parent with rigidbody, it invokes an event but there is no information about which collider hit the trigger. (OnCollide event has useful collision data but OnTrigger doesnt) When I attach script to blades OnTrigger simply doesnt fire, I believe that it fires only on objects with rigidbody. When I attach script and also rigidbodies to blades event starts firing but attached rigidbodies causes some strange behaviour to whole paddle. Also these rirgidbody seems to be kinda wrong architecturally - one object should have one RB.

    I dont have ideas what else could I try to make it work :)
     
  2. Elegarret

    Elegarret

    Joined:
    Feb 15, 2017
    Posts:
    18
    Maybe this pic would make question clearlier:)
    Screenshot_1.png