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 Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Best way to dynamically link large numbers of colliders

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

  1. KillHour


    Oct 25, 2015
    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.