bool Delta { get; set; }

robot_2Generated
code_blocksInput

Description

The Delta property of the DigitalInput struct in the Sandbox.VR namespace indicates the change in the input state since the last update. It returns a boolean value that reflects whether the IsPressed state has changed.

Usage

Use the Delta property to determine if the state of a digital input, such as a button press, has changed since the last frame or update. This can be useful for detecting input transitions, such as when a button is pressed or released.

For example, if you want to execute an action only when a button is pressed down, you can check if Delta is true and IsPressed is also true.

Example

// Example usage of the DigitalInput.Delta property
DigitalInput input = new DigitalInput();

// Check if the input state has changed
if (input.Delta)
{
    // Check if the input is currently pressed
    if (input.IsPressed)
    {
        // Execute action on button press
        PerformAction();
    }
    else
    {
        // Execute action on button release
        PerformReleaseAction();
    }
}

void PerformAction()
{
    // Code to execute when the button is pressed
}

void PerformReleaseAction()
{
    // Code to execute when the button is released
}