From 222d1830866d133ad2b804dc750ce2e718049f0b Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 19 Aug 2025 11:11:41 +0200 Subject: [PATCH] Fix grabbing from socket --- Runtime/Tools/Scripts/Socket.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Runtime/Tools/Scripts/Socket.cs b/Runtime/Tools/Scripts/Socket.cs index 94f0693..22a2163 100644 --- a/Runtime/Tools/Scripts/Socket.cs +++ b/Runtime/Tools/Scripts/Socket.cs @@ -165,7 +165,8 @@ namespace Passer { ReverseParenting, Joint, StaticJoint, - ColliderDuplication + ColliderDuplication, + ReverseJoint, } public AttachMethod attachMethod = AttachMethod.Unknown; @@ -277,6 +278,9 @@ namespace Passer { Attach(objectToAttach, false); } public bool Attach(GameObject objectToAttach, bool rangeCheck) { + if (objectToAttach == null) + return false; + bool success = Attach(objectToAttach.transform, rangeCheck); return success; } @@ -515,6 +519,7 @@ namespace Passer { attachedTransform = objRigidbody.transform; attachedHandle = handle; handle.socket = this; + attachMethod = AttachMethod.ReverseJoint; } protected virtual void AttachSocketParenting(Rigidbody objRigidbody, Handle handle, Rigidbody socketRigidbody) { @@ -648,6 +653,9 @@ namespace Passer { return; } break; + case AttachMethod.ReverseJoint: + ReleaseRigidbodyReverseJoint(); + break; default: if (this.rigidbodyDisabled != null)