Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop Support: null error when getting tracker #667

Open
pietru2004 opened this issue Aug 24, 2024 · 0 comments
Open

Desktop Support: null error when getting tracker #667

pietru2004 opened this issue Aug 24, 2024 · 0 comments

Comments

@pietru2004
Copy link
Contributor

addons\godot-xr-tools\objects\grab_points\grab_point_hand.gd

Whenever any code tries to use var tracker := XRServer.get_tracker(controller.tracker) as XRPositionalTracker when in desktop support mode it returns null which causes errors.
There should be some default behaviour for desktop support or when tracker is null

Example code to make items equipped into hands when player is in desktop mode.

var _pickup_right_node : XRToolsFunctionPickup
func select_item(target: Node3D):
	if !is_instance_valid(target):
		return
	var dropped_item=_pickup_right_node.picked_up_object
	_pickup_right_node._pick_up_object(target)
	right_held=target
	handle_dropped_item(dropped_item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant