From b4b989f5f7699ebd9faedbb16241a01c0872e540 Mon Sep 17 00:00:00 2001 From: Snorre Date: Sat, 5 Apr 2025 19:02:13 +0200 Subject: [PATCH] h --- scripts/XRHand.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/XRHand.cs b/scripts/XRHand.cs index 63e04ef..0c78fa1 100644 --- a/scripts/XRHand.cs +++ b/scripts/XRHand.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; public partial class XRHand : XRController3D { - List joints = new(); + List joints = new(); [Export] RigidBody3D rb; @@ -51,15 +51,19 @@ public partial class XRHand : XRController3D GD.Print("Picked up ", body); - Generic6DofJoint3D joint = new(); + PinJoint3D joint = new(); joint.NodeA = body.GetPath(); joint.NodeB = rb.GetPath(); joints.Add(joint); rb.AddChild(joint); joint.Position = Vector3.Zero; - joint.SetParamX(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f); - joint.SetParamY(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f); - joint.SetParamZ(Generic6DofJoint3D.Param.LinearLimitSoftness, 5f); + + PinJoint3D joint2 = new(); + joint2.NodeB = body.GetPath(); + joint2.NodeA = rb.GetPath(); + joints.Add(joint); + body.AddChild(joint); + joint.Position = Vector3.Zero; } } }