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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Configurable Joints

Discussion in 'DOTS Physics' started by backwheelbates, Apr 16, 2020.

  1. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    195
    *moving this thread to DOTS Physics

    Hi,

    I'm just getting into learning DOTS and ECS with Physics and I have a question about creating a Single Axis Spring.

    I've gone through the samples, and wasn't able to find a joint as robust as the classic configurable joint. Is this something that is being planned?

    Thanks for any advice on this!

    Eric
     
    AntonioModer likes this.
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    You can setup your own specific Joints by building up from the lower level Constraint Atoms.
    Most of the builtin Joint create functions are in the Unity Physics code base, however the LimitDOF joint creation code is in the samples.

    You could create your own joint for your own specific purposes by constructing you own NativeArray of Constraints.
    For example, one linear Constraint locks along 2 linear axes with Min and Max set to zero, another linear constraint locks on the third linear axis with Min and Max set to the hard spring limits and with a lower SpringFrequency & Damping to give you some softness, and a third angular Constraint would limit rotation (if desired).

    The SoftJoint samples test might also act as a good reference as it plays around with spring/damping values to create softer Joints.