Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Bug PhysicsShapeAuthoring not correctly using GeometryData

Discussion in 'DOTS Physics' started by pmurph03, Jul 14, 2021.

  1. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    48
    Hey, I'm working on adding DOTs support through physics shapes for my editor asset Easy Collider Editor u3d.as/xxw with a simple conversion step at the end that converts colliders to PhysicShapes.

    It all works great except I have two issues I can't seem to solve. One I can work around, the other I can't seem to find a solution for.

    The one I can't solve, and am hoping someone more experienced with dots has a solution for:
    When adding a PhysicsShapeAuthoring component, and using the SetBox method with BoxGeometry, the resulting PhysicsShape has a bevel of 0.05 regardless of the BevelRadius actually on the BoxGeometry. Getting the BoxGeometry back after using the SetBox (through GetBoxProperties) shows that it has the correct BevelRadius. But the component itself in the editor still uses the default of 0.05.

    I've also tried to GetBox, and SetBox in the next update after the conversion, but it still does not accept the BevelRadius that is set.

    The one I can work around:
    The first physic shape added onto a gameobject with an enabled mesh renderer by default completely ignores any type of GeometryData used with the set shape method. I've worked around this by following the compound collider information in the documentation that has each collider on a child gameobject. But I still don't feel that adding the PhysicsShape component, and calling SetBox with proper data should act like the "Fit to Enabled Render Meshes" button was clicked and discard the data.

    Thanks in advance for any help anyone can provide!



    (Update: I wasn't able to figure out why it wasn't respecting the box bevel value set on BoxGeometry, but I updated my asset and left the value modifiable in the UI, with a tool tip that it doesn't function right now. Just in case it gets fixed and works in the future. But if anyone with more experience has a solution, please let me know. Thanks!)
     
    Last edited: Jul 19, 2021
unityunity