Skip to content

Commit

Permalink
feat(Locomotion): add falling deceleration to MoveInPlace
Browse files Browse the repository at this point in the history
The MoveInPlace script now has a separate deceleration setting for when
the player is falling giving a more refined feel to falling off ledges
and not abruptly slowing down.
  • Loading branch information
thestonefox committed Jan 31, 2017
1 parent 6cec273 commit f659edd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Assets/VRTK/Scripts/Locomotion/VRTK_MoveInPlace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public enum DirectionalMethod
public float maxSpeed = 4;
[Tooltip("The speed in which the play area slows down to a complete stop when the user is no longer pressing the engage button. This deceleration effect can ease any motion sickness that may be suffered.")]
public float deceleration = 0.1f;
[Tooltip("The speed in which the play area slows down to a complete stop when the user is falling.")]
public float fallingDeceleration = 0.01f;
[Tooltip("How the user's movement direction will be determined. The Gaze method tends to lead to the least motion sickness. Smart decoupling is still a Work In Progress.")]
public DirectionalMethod directionMethod = DirectionalMethod.Gaze;
[Tooltip("The degree threshold that all tracked objects (controllers, headset) must be within to change direction when using the Smart Decoupling Direction Method.")]
Expand Down Expand Up @@ -290,7 +292,7 @@ protected virtual void FixedUpdate()
}
else if (currentSpeed > 0f)
{
currentSpeed -= deceleration;
currentSpeed -= (currentlyFalling ? fallingDeceleration : deceleration);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ Move In Place allows the user to move the play area by calculating the y-movemen
* **Speed Scale:** Lower to decrease speed, raise to increase.
* **Max Speed:** The max speed the user can move in game units. (If 0 or less, max speed is uncapped)
* **Deceleration:** The speed in which the play area slows down to a complete stop when the user is no longer pressing the engage button. This deceleration effect can ease any motion sickness that may be suffered.
* **Falling Deceleration:** The speed in which the play area slows down to a complete stop when the user is falling.
* **Direction Method:** How the user's movement direction will be determined. The Gaze method tends to lead to the least motion sickness. Smart decoupling is still a Work In Progress.
* **Smart Decouple Threshold:** The degree threshold that all tracked objects (controllers, headset) must be within to change direction when using the Smart Decoupling Direction Method.
* **Sensitivity:** The maximum amount of movement required to register in the virtual world. Decreasing this will increase acceleration, and vice versa.
Expand Down

0 comments on commit f659edd

Please sign in to comment.