bool UseRelativeTransform { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The UseRelativeTransform property of the VRTrackedObject class determines whether the transform of the GameObject is updated relative to the VR anchor or as an absolute world position. When set to true, the transform will be relative to the VR anchor, which is useful for maintaining consistent positioning in a VR environment. This can be particularly important for applications where the VR setup may change or when the user needs to maintain a consistent orientation relative to the VR space.

Usage

To use the UseRelativeTransform property, you can set it directly on an instance of VRTrackedObject. This property is a boolean, so it can be set to either true or false depending on whether you want the transform to be relative to the VR anchor or not.

Example usage:

VRTrackedObject trackedObject = new VRTrackedObject();
trackedObject.UseRelativeTransform = true; // Use relative transform

In this example, the trackedObject will update its transform relative to the VR anchor.

Example

VRTrackedObject trackedObject = new VRTrackedObject();
trackedObject.UseRelativeTransform = true; // Use relative transform