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 smooth player height control #519

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

Malcolmnixon
Copy link
Collaborator

@Malcolmnixon Malcolmnixon commented Sep 8, 2023

This pull request cleans up crouching and fixes issues #384 and #480 by:

  • Smoothly blending between player-controlled-height and software-override-height.
  • Block player-height from growing when blocked by a low ceiling.

The following video demonstrates its behavior in the test scenes - https://youtu.be/D43q14dIUKc

@Malcolmnixon Malcolmnixon added this to the 4.3.0 milestone Sep 8, 2023
Copy link
Contributor

@DigitalN8m4r3 DigitalN8m4r3 left a comment

Choose a reason for hiding this comment

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

Tested this in and out as it delivers a much needed feature that the XR Tools are lacking

*a way to prevent the players head from moving thru ceilings and blockade spots

Now this PR adds the above and some more as it accounts for the physical height change when the player suddenly stands up, the effect ingame is that the player is still under the blockade spot.

I might be biased as i was working on and off on a way to do just that but was to much locked in the idea of inducing a motion sickness way to do this, however since i had the chance to test this implementation and compare it to similar ideas in unity, i can say that this is it. It works and accounts for sitting/standing up and vice versa without breaking the immersion.

One thing i would like to request would be to add this to the possible 2.1 HotFix as it paths the way for other things such as the Seating PR #462 to work in a more homogeneous way

@pietru2004
Copy link
Contributor

I don't see much problems althrou the hand gui could have box for making finger straight, I keep bumping into my hand with it nor straight, well I guess it is not from this merge req...
Also I couldn't see problems with height ovverride change and the low celing worked and did not make my cam go throu it

Copy link
Contributor

@pietru2004 pietru2004 left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

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

lgtm, but needs testing!

@Malcolmnixon
Copy link
Collaborator Author

Added a YouTube video showing the new behavior.

@GeminiSquishGames
Copy link

GeminiSquishGames commented Oct 12, 2023

I can confirm this fixes my issue #480 with both plane collisions and terrain collisions. However, if I jump while uncrouching, it seems to have the side effect of jump boosting when you jump during the smooth uncrouching. This could be a feature, but not in all cases of controller.

Smoothly blend between player-controlled-height and software-override-height.
Block player-height from growing when blocked by a low ceiling.
Prevent double-jumping when jumping and standing-up at the same time.
@Malcolmnixon
Copy link
Collaborator Author

I tracked down the jump-boosting to a double-jump and prevented it with a better "standing on the ground" test.

@DigitalN8m4r3
Copy link
Contributor

lgtm, no double jump noticed :)

@Malcolmnixon Malcolmnixon merged commit 40a1d59 into GodotVR:master Oct 18, 2023
2 checks passed
@Malcolmnixon Malcolmnixon deleted the smooth-crouch branch October 18, 2023 23:09
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.

None yet

5 participants