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

Fix forward and backward motion when using on-screen touch joysticks. #4334

Merged

Conversation

rawnsley
Copy link
Contributor

The on-screen joysticks "stutter" when you try and go forward and back. This is caused by the Z component of velocity being inverted in order to map joystick-up to world-forward, but this.displacement is passed by reference so the Z component gets inverted back-and-forth every frame, the net effect of which is zero forward motion. Wiggling the joystick means that this.displacement is set correctly every frame and overrides the inversion, so it's not immediately obvious there's a problem, but movement feels "sticky".

Inverting the value when it was calculated seemed the most appropriate fix as the code is already making joystick-to-world-coordinate mapping assumptions there anyway.

@netpro2k
Copy link
Contributor

Nice find, and good fix. Thanks!

@netpro2k netpro2k merged commit fbaed2b into Hubs-Foundation:master Jun 24, 2021
@rawnsley rawnsley deleted the fix-for-on-screen-joystick branch September 2, 2021 07:37
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