Description
The IsPressed
property of the DigitalInput
struct in the Sandbox.VR
namespace indicates the current state of a digital input action, such as a button press in a VR environment. It returns true
if the input is currently pressed, and false
otherwise.
Usage
Use the IsPressed
property to determine if a specific digital input, like a button on a VR controller, is currently being pressed. This can be useful for handling input events in a VR application, such as triggering actions when a button is pressed.
Example
// Example of using the IsPressed property
DigitalInput input = new DigitalInput();
if (input.IsPressed)
{
// Execute logic when the input is pressed
PerformAction();
}
void PerformAction()
{
// Action to perform when the input is pressed
}