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

Players can sometimes see through walls #25

Closed kjack9 closed 8 years ago

kjack9 commented 8 years ago

Players can sometimes see through walls while ArmSwinging into a wall with Push Back mode enabled. Wall Clip Speed Penalty helps with this, but doesn't eliminate it. Push back override also helps.

I suspect the fact that ArmSwinging occurs in Update() and wall clip/push back occurs in FixedUpdate() is the cause here.

kjack9 commented 8 years ago

Confirmed - Arm Swinging moves the player forward before the physics update can detect the collision and push back. Not sure how to fix that without moving arm swinging to FixedUpdate (seems like a bad idea) or delaying arm swinging's movement until the next FixedUpdate (also seems like a bad idea).

kjack9 commented 8 years ago

I tried creating a temporary variable (proposedCameraRigAdjustment) that arm swinging adjusts when it runs rather than adjusting the camera rig transform directly. Then FixedUpdate() actually applies the move. This has the effect of making the input in Update() and the actual move in FixedUpdate().

It completely fixes this issue, but causes arm swinging to feel jittery. You can no longer arm swing into geometry, even temporarily. Arm swinging against a wall is rock solid with zero clipping.

However, the movement from arm swinging is now done out-of-sync with the frame rate, making arm swinging appear very jittery.

This isn't the right solution yet, but it's a good test.

kjack9 commented 8 years ago

This was finally resolved by the changes to Push Back in v1.1.

Resolved by #30