This commit is contained in:
Snorre 2025-04-05 18:12:02 +02:00
parent 69132de3e9
commit 853c5a506a

View file

@ -3,7 +3,7 @@ using System.Collections.Generic;
public partial class XRHand : XRController3D
{
List<Generic6DofJoint3D> joints = new();
List<PinJoint3D> 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);
}
}
}