I currently have this code:
#pragma strict var lockPos = 0; function Start () { } function Update() { transform.rotation = Quaternion.Euler(lockPos, transform.rotation.eulerAngles.y, lockPos); } function OnCollisionEnter(collision: Collision) { if (collision.rigidbody) { var fixedJoint: FixedJoint = gameObject.AddComponent(FixedJoint); fixedJoint.connectedBody = collision.rigidbody; fixedJoint.breakForce = 1000; fixedJoint. fixedJoint.breakTorque = 1000; } }
It works fine, no problems. But the distance between the 2 objects is a noticeable difference. I’m curious how/if i can with a fixedHinge can i reduce that distance.
Basically my object is coming from a launcher and i want it to stick to the object in place, the light grey are the ones that are being launched, the dark grey is the one that i want to be the base.
My question is:
A. Can the distance shown between be made to be connecting?
B. Is there an easier/more efficient way to do this that allows the same physics?
[2537-too+far.png|2537]
The above image is from my unity screen, the 2 lighter grey objects ARE connected to the dark grey object with the joint.
Thank you, used this forum a lot for other problems I’ve had and hope that you guys could give me a hand here!