Search Unity

Best way to dynamically link large numbers of colliders

Discussion in 'Physics for ECS' started by KillHour, May 25, 2020.

  1. KillHour

    KillHour

    Joined:
    Oct 25, 2015
    Posts:
    49
    I have a setup where I will potentially have a large number (dozens) of individual physics objects that all need to behave as one complex object (Think Legos attached together), and they need to be able to be attached and detached regularly at runtime. These combined objects also need to be able to collide with other combined objects. Furthermore, they need to be constrained to two axis of translation and one axis of rotation.

    I've been using a combination of fixed joints and DOF limiting joints to accomplish this, but I'm running into problems. If I connect each object to its neighbors, the entire combined object flexes like jello and the DOF joint starts to drift rotationally. If I connect each object to a single root object, the entire simulation breaks down as all the floating point errors compound to infinity.

    Should I be using compound shapes for this instead? I haven't seen a way to create or modify compound shapes at runtime and I have concerns about the performance of doing so.
     
    Hybridizer likes this.