bool Active { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Active property of the TrackedObject class in the Sandbox.VR namespace indicates whether the tracked object is currently accessible. If this property is set to false, the transform of the object will not update, meaning it will not reflect any changes in position or rotation in the virtual environment.

Usage

To use the Active property, you can check its value to determine if the tracked object is currently active and updating its transform. You can also set this property to true or false to enable or disable the tracking of the object, respectively.

Example

// Example of using the Active property

// Assume trackedObject is an instance of TrackedObject
TrackedObject trackedObject = new TrackedObject();

// Check if the tracked object is active
if (trackedObject.Active)
{
    // The object is active and its transform is updating
    // Perform operations that require the object to be active
}
else
{
    // The object is not active
    // Handle the inactive state
}

// Set the tracked object to active
trackedObject.Active = true;

// Set the tracked object to inactive
trackedObject.Active = false;