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. Dismiss Notice

Question TargetJoint3D, the missing physics joint

Discussion in 'Physics' started by Lord_Eniac, Mar 29, 2023.

  1. Lord_Eniac

    Lord_Eniac

    Joined:
    Jan 28, 2020
    Posts:
    48
    I've found TargetJoint2D to be quite useful over the years since its addition to 2D physics. I was curious as to why its 3D counterpart was never implemented by Unity?
     
  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,662
    TargetJoint2D is just a special case of a SpringJoint2D.

    So you can use a SpringJoint in 3D, set its ConnectedRigidbody to null, its distance to zero, and you get the equivalent of a TargetJoint3D.

    As to why this hasn't been added natively, it's probably because being such a simple thing it's pretty low priority. Go figure!;)
     
    Lord_Eniac likes this.
  3. Lord_Eniac

    Lord_Eniac

    Joined:
    Jan 28, 2020
    Posts:
    48
    It took me a little bit of tweaking, but using the SpringJoint was certainly the way to go. Physics can be really entertaining when it goes completely wrong! Thanks for the help.