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 sprinting node #264

Merged
merged 3 commits into from
Nov 16, 2022
Merged

Conversation

teddybear082
Copy link
Contributor

-Create XRToolsMovementSprint class

-Node should be child of FP Controller rather than any particular controller

-Allows user to select which controller to use to enable sprinting

-Allows user to select between toggle and hold modes for sprinting

-When enabled, sprinting will set both controllers' direct movement nodes' max speed variables to the sprint multiplier, which is a float clamped between 1-4x, and set by default at 2.0

-When sprinting is deactivated, the direct movement max speeds variables are returned to their original states (this means a player cannot be "sprinting" with one hand and "walking" with the other, without needing the information stored in the player_body node)

-Emits signals for when the player starts or stops sprinting so that, for instance, sound effects could be varied based on whether user is sprinting

-Before changes necessary to find direct_movement node due to ARVRHelpers.find_node() seemingly being broken
-Eliminate _overall_max_speed variable per prior review comments (sorry missed that one earlier)
Copy link
Collaborator

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, and I tested it by adding the sprinting to the basic movement demo with both the hold-to-sprint and toggle-sprinting as well as left and right controller.

I do think it deserves a nice demo by itself at some point.

@Malcolmnixon Malcolmnixon merged commit 5f167a0 into GodotVR:master Nov 16, 2022
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

Successfully merging this pull request may close these issues.

2 participants