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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Static hierarchy of colliders with conversion

Discussion in 'Physics for ECS' started by Jawsarn, Feb 7, 2020.

  1. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    208
    I noticed that there is a difference in the scenario of having a hierarchy of colliders (tested with one parent with X children). Where if the parent has a PhysicsBody(marked static), it will cause all the PhysicsCollider component to only end up on the parent, while all children doesn't have any PhysicsCollider, when not having a PhysicsCollider on the parent, the children will keep their physics collider each separatly. Is there any performance difference between these two setups? Or scenarios where you would want to setup as one vs the other?

    As an additional note, it would be nice if there is no additional component or reference to an entity to exclude it after the conversion, right now it creates entities with only translation rotation etc. if using the first approach.
    (Edit 1: noticed you could add a IConvert script to destroy the entity which solves this^^)
    (Edit 2: this fix seem to only work for conversion in scene and not through
    GameObjectConversionUtility.ConvertGameObjectHierarchy)
     
    Last edited: Feb 7, 2020
    florianhanke likes this.
  2. Adam-Mechtley

    Adam-Mechtley

    Unity Technologies

    Joined:
    Feb 5, 2007
    Posts:
    290
    Yes :) I suggest you view my Unite talk starting at 28:58

    The reason we don't do this is because we don't know if the user still wants those as "attachment points" for some other purpose. We could consider adding an option to clean them up
     
    steveeHavok, Jawsarn and florianhanke like this.
  3. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    208
    Thanks! Makes sense.

    This would be really nice as I see myself using a many gameObjects to represent only colliders.
     
    charleshendry likes this.