Because Hinge Joint 2D components do not have "spring properties" like their 3D counterparts, I made one. I did this by adding a Hinge Joint to connect Bones 1 and 2 of the tree. I then attached a Spring Joint to the circle above the tree, and connected this to the second bone. I then applied angle limits so it swings back and forth between -20 and 20.

enter image description here

This works very well when you apply a one-time force to a Rigid Body attached to Bone 2:

rb.AddTorque(2000f, ForceMode2D.Force); 

(I don't know why that much torque is needed to move it though). But it does lean and then spring back to the normal position.

However, the minute you add multiple forces within a short time span (for example, if you add forces within Update()), the tree will just fall to the left and get stuck there.

enter image description here

Even when the forces have stopped being applied, the tree will never spring back to its original position, as it does when only 1 force has been applied.

In this video, you can see the tree being operated first by a motor, then the motor is stopped, causing it to spring properly. After this, a few forces are applied one after the other and short succession - which causes it to get stuck on the left.

How do I fix this? Any help would be appreciated.

  • 1
    \$\begingroup\$ That sheep looked rather confused : D \$\endgroup\$
    – Mangata
    Jul 19 at 12:54
  • \$\begingroup\$ Glad you enjoyed the sheep! \$\endgroup\$ Jul 19 at 13:38


You must log in to answer this question.

Browse other questions tagged .