Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Can a trigger detect other Colliders in the same parent when the parent is the RigidBody ?

Discussion in 'Physics' started by chrisgun, Feb 5, 2024.

  1. chrisgun

    chrisgun

    Joined:
    Jun 15, 2021
    Posts:
    2
    So, I have parent object (A) with a RigidBody, and it's Colliders are all in children objects (A1,A2,A3,etc).
    I also have another object with a Collider asTrigger (B) to detect if it touch any part of (A).
    But as (A) is moving alot, and (B) needs to move alot too but relative to (A), I would like to set (B) as a child of (A).
    Problem is, when (B) is a child of (A), it seems unable to interact with any other children.
    I'm currently using OnTriggerEnter() in a script inside of (B) to detect the collision.
    From what I understant (A) can't detect collision within itself, wich make sense, but... it's what I need so...
    I would also rather not have to move & rotate (B) each fixedUpdate to follow (A), nor giving it a RigidBody component, as it isn't supposed to interfer in the physics of other objects.

    Thanks in advance for any advice!
     
  2. chrisgun

    chrisgun

    Joined:
    Jun 15, 2021
    Posts:
    2
    Figured out it's easier to just have a parent object (C) containing (A) & (B)