diff --git a/scripts/XRHand.cs b/scripts/XRHand.cs index 81545df..960f2f3 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 body; @@ -42,12 +42,18 @@ public partial class XRHand : XRController3D GD.Print("Picked up ", body); - Generic6DofJoint3D joint = new(); + PinJoint3D joint = new(); joint.NodeA = body.GetPath(); joint.NodeB = this.body.GetPath(); joints.Add(joint); + + PinJoint3D joint2 = new(); + joint2.NodeA = this.body.GetPath(); + joint2.NodeB = body.GetPath(); + joints.Add(joint2); - AddChild(joint); + this.body.AddChild(joint); + body.AddChild(joint2); } } }