Guides

VRTK_WarpObjectControlAction

extends VRTK_BaseObjectControlAction

Overview

Provides the ability to move a GameObject around by warping it across the x/z plane in the scene by updating the Transform position in defined steps when the corresponding Object Control axis changes.

The effect is a immediate snap to a new position in the given direction.

Required Components:

  • VRTK_ObjectControl - The Object Control script to listen for the axis changes on.

Optional Components:

  • VRTK_BodyPhysics - The Body Physics script to utilise when checking for potential collisions on movement.

Script Usage:

  • Place the VRTK_WarpObjectControlAction script on any active scene GameObject.
  • Link the required Object Control script to the Object Control Script parameter of this script.
  • Set the Listen On Axis Change parameter on this script to the axis change to affect with this movement type.

Inspector Parameters

  • Warp Distance: The distance to warp in the facing direction.
  • Warp Multiplier: The multiplier to be applied to the warp when the modifier button is pressed.
  • Warp Delay: The amount of time required to pass before another warp can be carried out.
  • Floor Height Tolerance: The height different in floor allowed to be a valid warp.
  • Blink Transition Speed: The speed for the headset to fade out and back in. Having a blink between warps can reduce nausia.
  • 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.

Example

VRTK/Examples/017_CameraRig_TouchpadWalking has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.

To enable the Warp Object Control Action, ensure one of the TouchpadControlOptions children (located under the Controller script alias) has the Warp control script active.