Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Hinge Joint - Use Spring

Discussion in 'Physics' started by JonathanAL, Jun 28, 2018.

  1. JonathanAL

    JonathanAL

    Joined:
    Jun 21, 2018
    Posts:
    3
    Hello! I am new to unity and my knowledge is still somewhat limited
    I have a doubt:
    It is possible, through script, to enable and disable the
    Use hinge Joint Spring?

    I've written a value in Damper, inside the Spring. But, I just want to use this Damper when I request it through some keyboard command, so
    I believe it is through script.
    Can you help me? Thank you!
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,522
    Hi, and welcome to Unity! While the SpringJoint component itself cannot be disabled, you may configure spring and damper to 0 from script when the joint is disabled. Simply restoring the values would re-enable the joint.
     
  3. JonathanAL

    JonathanAL

    Joined:
    Jun 21, 2018
    Posts:
    3
    I'm not using SpringJoint. What I want to disable and activate is the "Use Spring" within the "Hinge Joint". Is it possible?