ElectricNightOwl / ArmSwinger

ArmSwinger is an artificial VR locomotion library developed on Unity 5.4. ArmSwinger allows you to use your arms to control your position in 3D space in a natural way with minimal disorientation.
http://electricnightowl.com/armswinger/
MIT License
101 stars 30 forks source link

Push Back for instant climbing/falling should now work again #29

Closed kjack9 closed 7 years ago

kjack9 commented 7 years ago

22 removed code that wasn't so legacy after all. The code saved a RaycastHit to seed the height cache just before rewinding. This fixed an issue where the player could get on top of a too-high stair or wall even if they got pushed back. Unfortuantely, it also caused the infinite rewind issue in #20.

This commit changes the behavior to work in both instances. Rather than cache a RaycastHit from just before the push back, we shoot a new Raycast just AFTER making the correction move. This keeps the player at the right height during the pushback/rewind, prevents climbing too-high surfaces instantly, and doesn't freak out the next instant climb/fall check.

Please report any issues caused by this change - my test cases check out okay.