Transform Anchor { get; set; }

robot_2Generated
code_blocksInput

Description

The Anchor property of the VRInput class represents the center of the VR play area in world space. This property allows you to get or set the Transform that defines the position and orientation of the VR play area within the game world.

Usage

Use the Anchor property to adjust the central point of the VR play area. This can be useful for aligning the VR experience with the physical space or for dynamically adjusting the play area based on game logic.

To access or modify the Anchor property, you need to have an instance of the VRInput class. You can then use the property to retrieve or set the Transform:

Example

// Accessing the Anchor property
Transform currentAnchor = VRInput.Current.Anchor;

// Setting a new position for the Anchor
VRInput.Current.Anchor.position = new Vector3(0, 0, 0);

// Rotating the Anchor
VRInput.Current.Anchor.rotation = Quaternion.Euler(0, 90, 0);