Hi all, I am currently working on a system where an object that has a velocity, can hook onto another (static) object and thus swing around it. Since I want to use Physics, I came down to a configurable joint, but I am running into a small problem.
The initial rotation of when I add the joint, makes the object that hooks onto the other, teleport before working as expected (see GIF for visuals). Am I missing something that can fix this?
I have tried to use a connected anchor and setting the (connected) anchor myself, yet it doesn’t solve my problem. Below is the code used to instantiate and configure the joint
grappleJoint = movementObject.gameObject.AddComponent<ConfigurableJoint>();
grappleJoint.autoConfigureConnectedAnchor = false;
Vector3 grappleJointAnchorPosition = grappleJoint.transform.position - grappleAnchorTransform.position;
grappleJoint.anchor = grappleJointAnchorPosition;
grappleJoint.connectedAnchor = grappleAnchorTransform.position;
grappleJoint.xMotion = ConfigurableJointMotion.Locked;
grappleJoint.yMotion = ConfigurableJointMotion.Locked;
grappleJoint.zMotion = ConfigurableJointMotion.Locked;
Thanks in advance for any help