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.

Bug Unity Physics can't handle combined shapes like Havok can??

Discussion in 'Physics for ECS' started by Arnold_2013, Jan 5, 2023.

  1. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    186
    2023-BugMinerBuilding.PNG

    I have a building (root entity, kinematic) with 3 box colliders that collide with 'everything' and a sphere trigger that belongs to layer X and only collides with layer X.
    Prior to ECS1.0 this worked perfectly with Havok Physics (and it still does), but switching to Unity Physics the colliders just go crazy.
    The shape does not match anymore, and also the trigger collider seems to take part with some forces. The cubes are dynamic physics body's (see linked video for example).

    I've tried moving the sphere shape so it does not overlap the other shapes, but this did not help. (Also tried the 'force unique' checkbox, but was not expecting this to work)

    For this case I would expect Unity Physics and Havoc Physics to both work, since its not state/stateless, its not low speed objects...

    If I am doing something wrong please let me know.

     
    Last edited: Jan 5, 2023
  2. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    487
    I don't know about Havok. But Unity physics forces everything into a compound collider. Which is really annoying.
     
  3. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    186
    From what I know Havok also does this. But maybe it has a higher limit for the amount of shapes it can combine into a compound collider successfully?... I really don't know why this basic functionality should work differently between the two.

    As a workaround I now use a Mesh Collider for the collision colliders. And keep the Trigger collider as a sphere. Seems to work.
     
  4. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    44
    That's quite the interesting pen... um, building you have there. o_O:D
    Just wanted to say I also have this issue. Have been using mesh and/or isometric colliders as workaround, like you.
     
    TheOtherMonarch likes this.
  5. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    186
    Yeah it seems like a good workaround. In the mean time I have refactored the use of the 'trigger sphere' placing it on a separate entity. Syncing the location in a follow system. Leaving only the 3 box colliders which all have the same collision settings. This seems to work without issues.

    On the other point... hmmms guess its like the rabbit/duck image... once you know its impossible to not see it :oops:. I'll put a work item on the backlog. It will be a great day when this is my biggest issue with the game :D.
     
    TheOtherMonarch likes this.
  6. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    44
    I wouldn't worry too much about this. It's prob just me, since I tend to see these types of things everywhere. :confused:
     
    Arnold_2013 likes this.