From a0d2a00a3ab031df1151c5e05b95cc1ec8073c65 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Mon, 1 Sep 2025 11:36:19 +0200 Subject: [PATCH] Fix attachedHandle when attaching from the Editor --- Editor/Tools/Socket_Editor.cs | 3 +++ .../Scripts/Interaction/HandInteraction.cs | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Editor/Tools/Socket_Editor.cs b/Editor/Tools/Socket_Editor.cs index c9c7164..b1a5a2e 100644 --- a/Editor/Tools/Socket_Editor.cs +++ b/Editor/Tools/Socket_Editor.cs @@ -76,6 +76,8 @@ namespace Passer.Humanoid { } protected virtual void AttachPrefab(Socket socket, SerializedProperty attachedTransformProp, GameObject prefab) { + SerializedProperty attachedHandleProp = serializedObject.FindProperty("attachedHandle"); + if (attachedTransformProp.objectReferenceValue != null) ReleaseObject(socket, attachedTransformProp); @@ -87,6 +89,7 @@ namespace Passer.Humanoid { Debug.LogWarning("Could not attach transform"); else { attachedTransformProp.objectReferenceValue = obj; + attachedHandleProp.objectReferenceValue = socket.attachedHandle; //Handle handle = socket.attachedHandle; //if (handle == null) // Handle.Create(obj, socket); diff --git a/Runtime/HumanoidControl/Scripts/Interaction/HandInteraction.cs b/Runtime/HumanoidControl/Scripts/Interaction/HandInteraction.cs index 09b8bfa..a656542 100644 --- a/Runtime/HumanoidControl/Scripts/Interaction/HandInteraction.cs +++ b/Runtime/HumanoidControl/Scripts/Interaction/HandInteraction.cs @@ -580,10 +580,10 @@ namespace Passer.Humanoid { AdvancedHandPhysics.SetNonKinematic(handRigidbody, colliders); } - //if (handle.socket != null) { - // Debug.Log("Grab from socket"); - // handle.socket.Release(); - //} + if (handle.socket != null) { + Debug.Log("Grab from socket"); + handle.socket.Release(); + } targetToHandle = hand.target.transform.InverseTransformPoint(grabSocket.transform.position);