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

Add a way to rotate the hands around the Z axis #9

Open
jamie-pate opened this issue Nov 21, 2024 · 0 comments
Open

Add a way to rotate the hands around the Z axis #9

jamie-pate opened this issue Nov 21, 2024 · 0 comments

Comments

@jamie-pate
Copy link

jamie-pate commented Nov 21, 2024

I would suggest shift+E/Q+mousewheel to rotate the hands around the Z axis?

I've added it to my project by inheriting your scene :D

extends "res://addons/xr-simulator/XRSimulator.gd"

func _input(event):
	var mb := event as InputEventMouseButton
	if mb && mb.button_index in [MOUSE_BUTTON_WHEEL_DOWN, MOUSE_BUTTON_WHEEL_UP] && mb.shift_pressed:
		var amount := 1.0 if mb.button_index == MOUSE_BUTTON_WHEEL_DOWN else -1.0
		amount = (scroll_sensitivity * amount)/20
		var done := false
		if Input.is_physical_key_pressed(KEY_Q) or toggle_left_controller:
			left_controller.rotate_z(amount)
			done = true
		if Input.is_physical_key_pressed(KEY_E) or toggle_right_controller:
			right_controller.rotate_z(amount)
			done = true
		if done:
			return
	super(event)
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