Hi i am using a hinge joint to make a swinging effect however the hinge doesn’t do what i want to, is there another way to make a swinging effect where the object can get closer to the tethered point, because with the hinge it feels like solid but i want it to be like a rope or something but very simple between 2 points only. the hinge doesnt allow the object to come closer to the center only rotates
A realistic rope could be realized by a chain of configurable joints.
Create an empty gameObject and name it “rope”. Create a couple of children for your rope named “part1-x” and one named “base”. Position them in a straight line with fixed distances. The base is the fix point in the middle.
Give every part a rigidbody and a configurable joint (hinge joints only rotate around one axis like a door. use those if you want to make a 2D game). The base gets a kinematic rigidbody.
Now set up the connected body for each joint. Part1 gets the base, part2 gets part1 etc. Make sure the anchor matches with the position of the connected body.
To render the robe, the easiest thing would be a line renderer.
I would try a spring joint. Does pretty much exactly what you are asking for. You should be able to test it by modifying your script’s HingeJoint reference with SpringJoint and add a spring joint to your object in the inspector.
I would use Vector3.MoveTowards()