Description
The Active
property of the DigitalInput
struct in the Sandbox.VR
namespace indicates whether a specific VR digital input action is currently accessible. If this property is false
, the IsPressed
property will always return false
and will not change, effectively disabling the input action.
Usage
Use the Active
property to check if a digital input action is available for interaction. This can be useful for determining whether a button or control is currently enabled or disabled in a VR environment.
Example
// Example of checking if a VR digital input is active
DigitalInput input = new DigitalInput();
if (input.Active)
{
// The input is active, you can check if it is pressed
if (input.IsPressed)
{
// Handle the input being pressed
}
}
else
{
// The input is not active, handle accordingly
}