Fix attaching to moving sockets
This commit is contained in:
parent
f177384da3
commit
200db545b9
@ -504,6 +504,14 @@ namespace Passer {
|
||||
joint.breakForce = float.PositiveInfinity;
|
||||
joint.breakTorque = float.PositiveInfinity;
|
||||
|
||||
|
||||
Rigidbody socketRigidbody = GetComponent<Rigidbody>();
|
||||
if (socketRigidbody == null) {
|
||||
socketRigidbody = this.gameObject.AddComponent<Rigidbody>();
|
||||
socketRigidbody.isKinematic = true;
|
||||
}
|
||||
joint.connectedBody = socketRigidbody;
|
||||
|
||||
attachedTransform = objRigidbody.transform;
|
||||
attachedHandle = handle;
|
||||
handle.socket = this;
|
||||
@ -765,7 +773,7 @@ namespace Passer {
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Rigidbody
|
||||
#endregion Rigidbody
|
||||
|
||||
#region Static Object
|
||||
|
||||
@ -811,7 +819,7 @@ namespace Passer {
|
||||
|
||||
#endregion Static Object
|
||||
|
||||
#endregion Release
|
||||
#endregion Release
|
||||
|
||||
#region Start
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user