Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Can we get an option to opt out of physics compound colliders?

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by scottjdaley, Dec 8, 2022.

  1. scottjdaley

    scottjdaley

    Joined:
    Aug 1, 2013
    Posts:
    152
    The current compound collider authoring experience is quite handy for the times that you want it. However, there are some cases where you want child colliders. For example, if I have a object and want to do raycasts against a specific part of the object. It might be possible to dig through the compound collider and check if it hit the correct sub-collider, but it would be much easier to just have a child collider. This is possible to set up at runtime by simply setting the Parent of the child entity, but, as far as I know, it is impossible or quite difficult to do at runtime.

    Can we get some kind of option on Physics Shape to disable compound collider generation? Or perhaps a component that we can add to the child collider game object to prevent it from being included in the compound collider?

    Note: I'm not talking about dynamic rigid bodies here. I realize that there are complications with transform hierarchies and rigidbodies and that is a separate question (asked here already: https://forum.unity.com/threads/physics-entities-and-transform-hierarchies.1371111/). I'm just talking about allowing transform hierarchies on collider-only entities without the automatic compound collider creation at bake time.
     
    TheOtherMonarch likes this.
  2. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    819
    Yes, please allow rigid bodies to have non-rigid body child colliders. I have hit boxes separated from terrain/unit collision detection for a reason. I want the layers to remain separate.
     
    Last edited: Dec 22, 2022