Guides
These docs are for v3.2.0. Click to read the latest docs for v3.3.0.

VRTK_MoveInPlace

Overview

Move In Place allows the user to move the play area by calculating the y-movement of the user's headset and/or controllers. The user is propelled forward the more they are moving. This simulates moving in game by moving in real life.

This locomotion method is based on Immersive Movement, originally created by Highsight. Thanks to KJack (author of Arm Swinger) for additional work.

Inspector Parameters

  • Left Controller: If this is checked then the left controller touchpad will be enabled to move the play area.
  • Right Controller: If this is checked then the right controller touchpad will be enabled to move the play area.
  • Engage Button: Select which button to hold to engage Move In Place.
  • Control Options: Select which trackables are used to determine movement.
  • 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.
  • 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.
  • 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.
  • Body Physics: An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling.

Class Variables

  • public enum ControlOptions - Options for testing if a play space fall is valid.
  • HeadsetAndControllers - Track both headset and controllers for movement calculations.
  • ControllersOnly - Track only the controllers for movement calculations.
  • HeadsetOnly - Track only headset for movement caluclations.
  • public enum DirectionalMethod - Options for which method is used to determine player direction while moving.
  • Gaze - Player will always move in the direction they are currently looking.
  • ControllerRotation - Player will move in the direction that the controllers are pointing (averaged).
  • DumbDecoupling - Player will move in the direction they were first looking when they engaged Move In Place.
  • SmartDecoupling - Player will move in the direction they are looking only if their headset point the same direction as their controllers.
  • EngageControllerRotationOnly - Player will move in the direction that the controller with the engage button pressed is pointing.
  • LeftControllerRotationOnly - Player will move in the direction that the left controller is pointing.
  • RightControllerRotationOnly - Player will move in the direction that the right controller is pointing.

Class Methods

SetControlOptions/1

public virtual void SetControlOptions(ControlOptions givenControlOptions)

  • Parameters
  • ControlOptions givenControlOptions - The control options to set the current control options to.
  • Returns
  • none

Set the control options and modify the trackables to match.

GetMovementDirection/0

public virtual Vector3 GetMovementDirection()

  • Parameters
  • none
  • Returns
  • Vector3 - Returns a vector representing the player's current movement direction.

The GetMovementDirection method will return the direction the player is moving.

GetSpeed/0

public virtual float GetSpeed()

  • Parameters
  • none
  • Returns
  • float - Returns a float representing the player's current movement speed.

The GetSpeed method will return the current speed the player is moving at.

Example

VRTK/Examples/042_CameraRig_MoveInPlace demonstrates how the user can move and traverse colliders by either swinging the controllers in a walking fashion or by running on the spot utilisng the head bob for movement.