Skip to content

Commit

Permalink
[fix] default camera and controller positions make player body emit e…
Browse files Browse the repository at this point in the history
…rrors
  • Loading branch information
Cafezinhu authored Sep 25, 2024
1 parent 2e32e3d commit 0f2b5c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/xr-simulator/XRSimulator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ var key_map = {
func _on_node_added(node: Node):
if node is XRCamera3D:
camera = node
camera.rotate_y(deg_to_rad(1.0))
elif node is XRController3D:
var pose = node.pose
if node.tracker == "left_hand":
node.position.x += -0.1
left_controller = node
left_tracker.set_pose(pose, node.transform, Vector3.ZERO, Vector3.ZERO, XRPose.XR_TRACKING_CONFIDENCE_HIGH)
XRServer.add_tracker(left_tracker)
elif node.tracker == "right_hand":
node.position.x += 0.1
right_controller = node
right_tracker.set_pose(pose, node.transform, Vector3.ZERO, Vector3.ZERO, XRPose.XR_TRACKING_CONFIDENCE_HIGH)
XRServer.add_tracker(right_tracker)
Expand Down

0 comments on commit 0f2b5c9

Please sign in to comment.