Guides
Guides

VRTK_SnapRotateObjectControlAction

extends VRTK_BaseObjectControlAction

Overview

Provides the ability to snap rotate a GameObject through the world y axis in the scene by updating the Transform rotation in defined steps when the corresponding Object Control axis changes.

The effect is a immediate snap rotation to quickly face in a new direction.

Required Components:

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

Script Usage:

  • Place the VRTK_SnapRotateObjectControlAction 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

  • Angle Per Snap: The angle to rotate for each snap.
  • Angle Multiplier: The snap angle multiplier to be applied when the modifier button is pressed.
  • Snap Delay: The amount of time required to pass before another snap rotation can be carried out.
  • Blink Transition Speed: The speed for the headset to fade out and back in. Having a blink between rotations can reduce nausia.
  • Axis Threshold: The threshold the listened axis needs to exceed before the action occurs. This can be used to limit the snap rotate to a single axis direction (e.g. pull down to flip rotate). The threshold is ignored if it is 0.

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 Snap Rotate Object Control Action, ensure one of the TouchpadControlOptions children (located under the Controller script alias) has the Snap Rotate control script active.