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

Modify hand.gd to hide hands when not active #349

Open
Malcolmnixon opened this issue Jan 28, 2023 · 3 comments
Open

Modify hand.gd to hide hands when not active #349

Malcolmnixon opened this issue Jan 28, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Malcolmnixon
Copy link
Collaborator

Currently the hands remain visible when not active. The hand.gd script should be modified to hide the hand when inactive. Also signals should be added when the hands become hidden and visible.

@BastiaanOlij
Copy link
Member

I think code for the signals should be on a script that is on the ARVRController itself, hand.gd can then subscribe to these signals and hide/unhide the hand mesh.

This will also allow other child nodes to react to this properly without having to embed the same logic as there are now a few steps to detecting hands (is the tracker active, if so, is it actually tracking, etc).

We could extend on that in time and have various function react as well, say a movement function is only active if it is enabled and the hand it is attached to is tracking.

The thing to prevent is to react too directly to lost tracking. For instance a player who is striking a sword may loose tracking when the controller goes out of view, and as a result drop the sword if functions become inactive.

One nice feature here is that if we're detecting the ARVRController becoming inactive, that we set a timer, if it stays inactive for more then say 5 seconds, we emit a different signal. Say we define: controller_became_active, controller_became_inactive, controller_inactive_timeout or something.

@BastiaanOlij BastiaanOlij added the enhancement New feature or request label Jan 28, 2023
@BastiaanOlij BastiaanOlij added this to the 3.3.0 milestone Jan 28, 2023
@BastiaanOlij BastiaanOlij modified the milestones: 3.3.0, 3.4.0 Feb 24, 2023
@BastiaanOlij BastiaanOlij modified the milestones: 3.4.0, 3.5.0 Mar 4, 2023
@BastiaanOlij BastiaanOlij modified the milestones: 3.5.0, 3.6.0 Apr 22, 2023
@Malcolmnixon
Copy link
Collaborator Author

I was reviewing the Godot 4 API and it looks like the information we want is exposed by XRNode3D.get_has_tracking_data(). It's a little annoying that we have to add a script to the controller to poll for it rather than having it emitted as a signal when the tracking data state changes.

@Malcolmnixon
Copy link
Collaborator Author

This is now dependent on godotengine/godot#81239 targeting Godot 4.2

@Malcolmnixon Malcolmnixon modified the milestones: 3.6.0, 4.3.0 Sep 6, 2023
@BastiaanOlij BastiaanOlij modified the milestones: 4.3.0, 4.4.0 Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants