> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_v_r_events.md).

# VREvents

**Usage:** `api.VREvents.OnTrigger(true)`

VR controller input helpers. Every method takes `ctrl` where true = left controller and false = right controller, and returns false when that controller is null.

## Public Functions

|      | Name                                                                                                                                                                                                                                                                                                                                               |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-onsqueeze"><strong>OnSqueeze</strong></a>(bool ctrl)<br>True on the single frame the squeeze (grip/select) button is first pressed.</p>                                                                                   |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-squeezing"><strong>Squeezing</strong></a>(bool ctrl)<br>True for every frame the squeeze button is held down.</p>                                                                                                         |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-onunsqueeze"><strong>OnUnsqueeze</strong></a>(bool ctrl)<br>True on the single frame the squeeze button is released.</p>                                                                                                  |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-ontrigger"><strong>OnTrigger</strong></a>(bool ctrl)<br>True on the single frame the trigger (activate) button is first pressed.</p>                                                                                      |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-triggering"><strong>Triggering</strong></a>(bool ctrl)<br>True for every frame the trigger is held down.</p>                                                                                                              |
| bool | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-onuntrigger"><strong>OnUntrigger</strong></a>(bool ctrl)<br>True on the single frame the trigger is released.</p>                                                                                                         |
| void | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-addongrab"><strong>AddOnGrab</strong></a>(XRGrabInteractable grabInteractable, Action< SelectEnterEventArgs > callback)<br>Registers a script callback fired when the interactable is grabbed (selectEntered).</p>        |
| void | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-addonreleased"><strong>AddOnReleased</strong></a>(XRGrabInteractable grabInteractable, Action< SelectExitEventArgs > callback)<br>Registers a script callback fired when the interactable is released (selectExited).</p> |
| void | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-togglemovement"><strong>ToggleMovement</strong></a>(bool enable)<br>Enables or disables the player's continuous-movement locomotion component.</p>                                                                        |
| void | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_v_r_events.md#function-toggleteleport"><strong>ToggleTeleport</strong></a>(bool enable)<br>Enables or disables the player's teleport locomotion component.</p>                                                                                   |

## Public Functions Documentation

### function OnSqueeze

```csharp
static bool OnSqueeze(
    bool ctrl
)
```

True on the single frame the squeeze (grip/select) button is first pressed.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether squeeze was pressed this frame.

### function Squeezing

```csharp
static bool Squeezing(
    bool ctrl
)
```

True for every frame the squeeze button is held down.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether squeeze is currently held.

### function OnUnsqueeze

```csharp
static bool OnUnsqueeze(
    bool ctrl
)
```

True on the single frame the squeeze button is released.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether squeeze was released this frame.

### function OnTrigger

```csharp
static bool OnTrigger(
    bool ctrl
)
```

True on the single frame the trigger (activate) button is first pressed.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether the trigger was pressed this frame.

### function Triggering

```csharp
static bool Triggering(
    bool ctrl
)
```

True for every frame the trigger is held down.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether the trigger is currently held.

### function OnUntrigger

```csharp
static bool OnUntrigger(
    bool ctrl
)
```

True on the single frame the trigger is released.

**Parameters**:

* **ctrl** True for the left controller, false for the right.

**Return**: Whether the trigger was released this frame.

### function AddOnGrab

```csharp
static void AddOnGrab(
    XRGrabInteractable grabInteractable,
    Action< SelectEnterEventArgs > callback
)
```

Registers a script callback fired when the interactable is grabbed (selectEntered).

**Parameters**:

* **grabInteractable** The interactable to listen on.
* **callback** Callback receiving the select-enter event args.

### function AddOnReleased

```csharp
static void AddOnReleased(
    XRGrabInteractable grabInteractable,
    Action< SelectExitEventArgs > callback
)
```

Registers a script callback fired when the interactable is released (selectExited).

**Parameters**:

* **grabInteractable** The interactable to listen on.
* **callback** Callback receiving the select-exit event args.

### function ToggleMovement

```csharp
static void ToggleMovement(
    bool enable
)
```

Enables or disables the player's continuous-movement locomotion component.

**Parameters**:

* **enable** True to allow movement, false to lock it.

### function ToggleTeleport

```csharp
static void ToggleTeleport(
    bool enable
)
```

Enables or disables the player's teleport locomotion component.

**Parameters**:

* **enable** True to allow teleporting, false to lock it.

***

Updated on 2026-07-22 at 12:00:00 +0800
