aframe-extras icon indicating copy to clipboard operation
aframe-extras copied to clipboard

fix for y velocity persisting after fly toggled off

Open ciaran-deegan-davra opened this issue 2 years ago • 0 comments

When fly mode is active and a user begins to travel, a velocity is (potentially) set on the y-axis. When fly mode is de-activated, the velocity calculation ignores the y-axis, causing the velocity to carry over from when the user was in fly mode.

To reproduce:

  • with fly mode active, move up/down
  • disable fly mode (via setAttribute or otherwise)
  • move forwards

Expected Results:

  • the user y-position does not change while moving forwards once fly mode has been de-activated

Actual Results:

  • the user's y-position continues along the same line as when fly mode was de-activated, giving a flying effect when fly mode has been disabled

This change explicitly sets y-axis velocity to 0 when not flying, fixing the issue. Fixes #305.

ciaran-deegan-davra avatar Jul 19 '22 23:07 ciaran-deegan-davra