# GvrBasePointer Class Reference

# GvrBasePointer

**This is an abstract class.**   

An abstract class for handling pointer based input.

## Summary

This abstract class should be implemented for pointer based input, and used with the [GvrPointerInputModule](https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule) script.

It provides methods called on pointer interaction with in-game objects and UI, trigger events, and 'BaseInputModule' class state changes.

To have the methods called, an instance of this (implemented) class must be registered with the **GvrPointerManager** script in 'Start' by calling [GvrPointerInputModule.OnPointerCreated](https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule_1ac50c1204f9c97c7a2b81264c9f2632f3).

This abstract class should be implemented by pointers doing 1 of 2 things:

1. Responding to movement of the users head (Cardboard gaze-based-pointer).
2. Responding to the movement of the daydream controller (Daydream 3D pointer).

<br />

### Inheritance

Inherits from: MonoBehaviour, [IGvrControllerInputDeviceReceiver](https://developers.google.com/vr/reference/unity/interface/IGvrControllerInputDeviceReceiver)  
Direct Known Subclasses:[GvrLaserPointer](https://developers.google.com/vr/reference/unity/class/GvrLaserPointer), [GvrReticlePointer](https://developers.google.com/vr/reference/unity/class/GvrReticlePointer)

| ### Public types ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe{ https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fea967d35e40f3f95b1f538bd248640bf3b, https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73feafd1dd0c603be8170f9eae0be9f2f6afb, https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73feafb1b6e23a3767d2a31ef7899e6dd3f1e }` | enumThe method by which GvrPointer perorms Raycasts. |

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a370551554fbce4b39e31d39e6f85f1f3` | `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fea967d35e40f3f95b1f538bd248640bf3b` Determines the `eventCamera` for `https://developers.google.com/vr/reference/unity/class/GvrPointerPhysicsRaycaster#classGvrPointerPhysicsRaycaster` and `https://developers.google.com/vr/reference/unity/class/GvrPointerGraphicRaycaster#classGvrPointerGraphicRaycaster`. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a7e3cb3d0c4d4b3dc90d871ed606ea08d = RaycastMode.Hybrid` | `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe` Determines which raycast mode to use for this raycaster. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1af335b9875167e856f94954cae2ab8883` | `float` Gets the location where the ray from the pointer will intersect with the ray from the camera when using the Hybrid raycast mode. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a56c5a9212881c3968b51ac93c18874f6` | `https://developers.google.com/vr/reference/unity/class/GvrControllerInputDevice#classGvrControllerInputDevice` Gets or sets the reference to the controller input device. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1ad86b0939801681a80d8e1a3adf091a15` | `float` Gets the current radius of the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a5c5703b47526444374755fb28d450d91` | `RaycastResult` Gets the current RaycastResult. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a7053ce597504541925569919dee0c20c` | `bool` Gets a value indicating whether the pointer will be used for generating input events by `https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule`. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a53302cb75dd81c8c051a972243f59c8c` | `bool` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `CurrentRaycastResult.gameObject != null`. Gets a value indicating whether the pointer raycast intersects any object. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1ae89a6cf1527ec8e382d4c783c8de7acf` | `bool` Gets a value indicating whether the user is currently touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8744a2effdcf212cba06d1a8eaa7ca06` | `abstract float` Gets the max distance from the pointer that raycast hits will be detected. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a19918496f3f22d385bd8b334b11e4779` | `Vector3` Gets the end point of the pointer when it is MaxPointerDistance away from the origin. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a345d346ce7b092756f885fc6103b92a8` | `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fea967d35e40f3f95b1f538bd248640bf3b` Gets the camera used as the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a13d41e5ce9d5c7e861d96b028ced4316` | `Vector3` **[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `CurrentRaycastResult.worldPosition`. Gets the pointer intersection. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1aaaf283329476d488211549671497f0e2` | `Transform` Gets the transform that represents this pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a629f3d4f6745eb382aa581f8474ee0b7` | `bool` Gets or sets a value indicating whether the `enterRadius` should be used for the raycast or the `exitRadius` should be used. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a49dde834030f347e621e999e21383fee` | `bool` Gets a value indicating whether the user just started touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a47998b13ad060cf8d1193342278dc1ab` | `Vector2` Gets the position of the current touch, if touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a3e31994d7c47bae755990f5fecf4ac1e` | `bool` Gets a value indicating whether the user just stopped touching the touchpad. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1ab96181e9b83a069ca66798e194f6c129` | `bool` Gets a value indicating whether the trigger was just pressed. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a86715f64089a2e824c502a3b2ef684cc` | `bool` Gets a value indicating whether the trigger was just released. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a262d56d260a172a6df9aabbaf1e7af25` | `bool` Gets a value indicating whether the trigger is currently being pressed. |

| ### Public static functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a3387b2d6d688815e0dddccce20b52e44(https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer pointer, https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe hybridMode)` | `https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay` Calculates the ray for the segment of the Hybrid raycast determined by the raycast mode passed in. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1aa65f6a104629d58bd7eb98f7bb1d9949(https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer pointer, https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe mode)` | `https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay` Calculates the ray for a given Raycast mode. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a3a9c9f47e13dce7c7657ed3d4c7d68f9(float distance)` | `Vector3` Returns a point in worldspace a specified distance along the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a179f07169f1733a87453acf63df2c227(out float enterRadius, out float exitRadius)` | `virtual abstract void` Return the radius of the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8402b52cf9f8f825baf4e2424ddb0f53(float distance)` | `https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay` Returns the ray used for projecting points out of the pointer for the given distance. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1ad17d5039d19643816b20a01e55f9cab5()` | `virtual abstract void` Called when a click is initiated. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a4f462c6acb94345e0c83656b282c0b2e()` | `virtual abstract void` Called when click is finished. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8f6d6374f1a4cf54ae1939fa52f5904a(RaycastResult raycastResult, bool isInteractive)` | `virtual abstract void` Called when the pointer is facing a valid GameObject. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a94844fb2c51882802d35922bcc68600a(GameObject previousObject)` | `virtual abstract void` Called when the pointer no longer faces an object previously intersected with a ray projected from the camera. |
| `https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a6dd3c59615a2588eb356544f1ce38424(RaycastResult raycastResultResult, bool isInteractive)` | `virtual abstract void` Called every frame the user is still pointing at a valid GameObject. |

| ### Structs ||
|---|---|
| [GvrBasePointer.PointerRay](https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay) | Represents a ray segment for a series of intersecting rays. |

## Public types

### RaycastMode

```c#
 RaycastMode
```
The method by which GvrPointer perorms Raycasts.

Camera is usually ideal at long range, Direct is usually ideal at close range, and Hybrid interpolates between the two depending on range.

| Properties ||
|---|---|
| `Camera` | Camera-based raycasting. Detects collisions for the pointer from the Camera. Casts a ray from the camera through the target of the pointer. This is ideal for reticles that are always rendered on top. The object that is selected will always be the object that appears underneath the reticle from the perspective of the camera. This also prevents the reticle from appearing to "jump" when it starts/stops hitting an object. Recommended for reticles that are always rendered on top such as the [GvrReticlePointer](https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer) prefab which is used for cardboard apps. Note: This will prevent the user from pointing around an object to hit something that is out of sight. This isn't a problem in a typical use case. When used with the standard daydream controller, the hit detection will not account for the laser correctly for objects that are closer to the camera than the end of the laser. In that case, it is recommended to do one of the following things: 1. Hide the laser. 2. Use a full-length laser pointer in Direct mode. 3. Use the Hybrid raycast mode. <br /> |
| `Direct` | Direct raycasting. Detects collisions for the pointer from the Controller. Cast a ray directly from the pointer origin. Recommended for full-length laser pointers. |
| `Hybrid` | Hybrid raycasting. Interpolates between Camera and Direct based on distance. Default method for casting ray. Combines the Camera and Direct raycast modes. Uses a Direct ray up until the CameraRayIntersectionDistance, and then switches to use a Camera ray starting from the point where the two rays intersect. Recommended for use with the standard settings of the GvrControllerPointer prefab. This is the most versatile raycast mode. Like Camera mode, this prevents the reticle appearing jumpy. Additionally, it still allows the user to target objects that are close to them by using the laser as a visual reference. |

## Public attributes

### overridePointerCamera

```c#
Camera overridePointerCamera
```
Determines the `eventCamera` for `https://developers.google.com/vr/reference/unity/class/GvrPointerPhysicsRaycaster#classGvrPointerPhysicsRaycaster` and `https://developers.google.com/vr/reference/unity/class/GvrPointerGraphicRaycaster#classGvrPointerGraphicRaycaster`.

Additionaly, this is used to control what camera to use when calculating the Camera ray for the Hybrid and Camera raycast modes.

### raycastMode

```c#
RaycastMode raycastMode = RaycastMode.Hybrid
```
Determines which raycast mode to use for this raycaster.

Supports the following modes:

- Camera - Ray is cast from the camera through the pointer.
- Direct - Ray is cast forward from the pointer.
- Hybrid - Begins with a Direct ray and transitions to a Camera ray.

<br />

## Properties

### CameraRayIntersectionDistance

```c#
float CameraRayIntersectionDistance
```
Gets the location where the ray from the pointer will intersect with the ray from the camera when using the Hybrid raycast mode.

The location where the ray from the pointer will intersect with the ray from the camera when using the Camera raycast mode.

### ControllerInputDevice

```c#
GvrControllerInputDevice ControllerInputDevice
```
Gets or sets the reference to the controller input device.

The reference to the controller input device.

### CurrentPointerRadius

```c#
float CurrentPointerRadius
```
Gets the current radius of the pointer.

Gets the `exitRadius` if `ShouldUseExitRadiusForRaycast` is `true`, otherwise returns the `enterRadius`.

The current pointer radius.

### CurrentRaycastResult

```c#
RaycastResult CurrentRaycastResult
```
Gets the current RaycastResult.

A convenience function for fetching the object the pointer is currently hitting.

The current raycast result.

### IsAvailable

```c#
bool IsAvailable
```
Gets a value indicating whether the pointer will be used for generating input events by `https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule`.

Value `true` if the pointer will be used for generating input events by `https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule`, `false`.

### IsPointerIntersecting

```c#
bool IsPointerIntersecting
```
Gets a value indicating whether the pointer raycast intersects any object.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `CurrentRaycastResult.gameObject != null`.

Value `true` if the pointer raycast intersects any object, otherwise `false`.

### IsTouching

```c#
bool IsTouching
```
Gets a value indicating whether the user is currently touching the touchpad.

Used by `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput` to generate `OnScroll` events using Unity's event system. Defaults to `ControllerInputDevice.GetButton(TouchPadTouch)`, can be overridden to change the input source.

Value `true` the user is currently touching the touchpad; otherwise, `false`.

### MaxPointerDistance

```c#
abstract float MaxPointerDistance
```
Gets the max distance from the pointer that raycast hits will be detected.

The max pointer distance from the pointer that raycast hits will be detected.

### MaxPointerEndPoint

```c#
Vector3 MaxPointerEndPoint
```
Gets the end point of the pointer when it is MaxPointerDistance away from the origin.

The end point of the pointer when it is MaxPointerDistance away from the origin.

### PointerCamera

```c#
Camera PointerCamera
```
Gets the camera used as the pointer.

The camera used as the pointer.

### PointerIntersection

```c#
Vector3 PointerIntersection
```
Gets the pointer intersection.

**[Deprecated.](https://developers.google.com/vr/reference/unity/deprecated/deprecated)** Replaced by `CurrentRaycastResult.worldPosition`.

The pointer intersection.

### PointerTransform

```c#
Transform PointerTransform
```
Gets the transform that represents this pointer.

It is used by `https://developers.google.com/vr/reference/unity/class/GvrBasePointerRaycaster#classGvrBasePointerRaycaster` as the origin of the ray.

The pointer transform.

### ShouldUseExitRadiusForRaycast

```c#
bool ShouldUseExitRadiusForRaycast
```
Gets or sets a value indicating whether the `enterRadius` should be used for the raycast or the `exitRadius` should be used.

It is set by `https://developers.google.com/vr/reference/unity/class/GvrPointerInputModule#classGvrPointerInputModule` and doesn't need to be controlled manually.

Value `true` if enterRadius should be used for the racyast, `false` otherwise.

### TouchDown

```c#
bool TouchDown
```
Gets a value indicating whether the user just started touching the touchpad.

This is an event flag; it is `true` for only one frame after the event happens, then reverts to false. Used by `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput` to generate `OnScroll` events using Unity's event system. Defaults to `ControllerInputDevice.GetButtonDown(TouchPadTouch)`, can be overridden to change the input source.

Value `true` if the user just started touching the touchpad, `false` otherwise.

### TouchPos

```c#
Vector2 TouchPos
```
Gets the position of the current touch, if touching the touchpad.

If not touching, this is the position of the last touch (when the finger left the touchpad).

The X and Y range is from 0 to 1. (0, 0) is the top left of the touchpad and (1, 1) is the bottom right of the touchpad. Used by `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput` to generate `OnScroll` events using Unity's event system. Defaults to `ControllerInputDevice.TouchPos` but translated to top-left-relative coordinates for backwards compatibility. Can be overridden to change the input source.

The touch position.

### TouchUp

```c#
bool TouchUp
```
Gets a value indicating whether the user just stopped touching the touchpad.

This is an event flag; it is `true` for only one frame after the event happens, then reverts to false. Used by `https://developers.google.com/vr/reference/unity/class/GvrPointerScrollInput#classGvrPointerScrollInput` to generate `OnScroll` events using Unity's event system. Defaults to `ControllerInputDevice.GetButtonUp(TouchPadTouch)`, can be overridden to change the input source.

The touch up.

### TriggerDown

```c#
bool TriggerDown
```
Gets a value indicating whether the trigger was just pressed.

This is an event flag. It will be true for only one frame after the event happens. Defaults to mouse button 0 down on Cardboard or `ControllerInputDevice.GetButtonDown(TouchPadButton)` on Daydream. Can be overridden to change the trigger.

Value `true` if the trigger was just pressed, `false` otherwise.

### TriggerUp

```c#
bool TriggerUp
```
Gets a value indicating whether the trigger was just released.

This is an event flag; it will be true for only one frame after the event happens. Defaults to mouse button 0 up on Cardboard or `ControllerInputDevice.GetButtonUp(TouchPadButton)` on Daydream. Can be overridden to change the trigger.

Value `true` if the trigger was just released, `false` otherwise.

### Triggering

```c#
bool Triggering
```
Gets a value indicating whether the trigger is currently being pressed.

This is not an event; it represents the trigger's state (it remains true while the trigger is being pressed). Defaults to mouse button 0 state on Cardboard or `ControllerInputDevice.GetButton(TouchPadButton)` on Daydream. Can be overridden to change the trigger.

Value `true` if the trigger is currently being pressed, `false` otherwise.

## Public static functions

### CalculateHybridRay

```c#
PointerRay CalculateHybridRay(
  GvrBasePointer pointer,
  RaycastMode hybridMode
)
```
Calculates the ray for the segment of the Hybrid raycast determined by the raycast mode passed in.

Throws an exception if Hybrid is passed in.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `pointer` | Which pointer to project the ray from. | | `hybridMode` | Which Raycast sub-mode to use within Hybrid mode. Must be Camera or Direct. | |
| **Returns** | The [PointerRay](https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay) as projected from the GvrbasePointer in the given mode. |

### CalculateRay

```c#
PointerRay CalculateRay(
  GvrBasePointer pointer,
  RaycastMode mode
)
```
Calculates the ray for a given Raycast mode.

Will throw an exception if the raycast mode Hybrid is passed in. If you need to calculate the ray for the direct or camera segment of the Hybrid raycast, use CalculateHybridRay instead.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `pointer` | Which pointer to project the ray from. | | `mode` | Which Raycast mode to use. Must be Camera or Direct. | |
| **Returns** | The [PointerRay](https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay) as projected from the GvrbasePointer in the given mode. |

## Public functions

### GetPointAlongPointer

```c#
Vector3 GetPointAlongPointer(
  float distance
)
```
Returns a point in worldspace a specified distance along the pointer.

What this point will be is different depending on the raycastMode.

Because raycast modes differ, use this function instead of manually calculating a point projected from the pointer.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `distance` | The distance along the pointer's laser. | |
| **Returns** | A worlspace position along the pointer's laser. |

### GetPointerRadius

```c#
virtual abstract void GetPointerRadius(
  out float enterRadius,
  out float exitRadius
)
```
Return the radius of the pointer.

It is used by [GvrPointerPhysicsRaycaster](https://developers.google.com/vr/reference/unity/class/GvrPointerPhysicsRaycaster#classGvrPointerPhysicsRaycaster) when searching for valid pointer targets. If a radius is 0, then a ray is used to find a valid pointer target. Otherwise it will use a SphereCast.

The *enterRadius* is used for finding new targets while the *exitRadius* is used to see if you are still nearby the object currently pointed at to avoid a flickering effect when just at the border of the intersection.

NOTE: This is only works with [GvrPointerPhysicsRaycaster](https://developers.google.com/vr/reference/unity/class/GvrPointerPhysicsRaycaster#classGvrPointerPhysicsRaycaster). To use it with uGUI, add 3D colliders to your canvas elements.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `enterRadius` | Used for finding new targets. | | `exitRadius` | Used to see if the pointer is still nearby the object currently pointed at. This exists to avoid a flickering effect when just at the border of the intersection. | |

### GetRayForDistance

```c#
PointerRay GetRayForDistance(
  float distance
)
```
Returns the ray used for projecting points out of the pointer for the given distance.

In Hybrid raycast mode, the ray will be different depending upon the distance. In Camera or Direct raycast mode, the ray will always be the same.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `distance` | The distance to check. | |
| **Returns** | Either the Camera or Controller's [PointerRay](https://developers.google.com/vr/reference/unity/struct/GvrBasePointer/PointerRay#structGvrBasePointer_1_1PointerRay). For Hybrid mode, this will return Camera at large distances and Controller at close distances. For other modes, the ray will always be the mode's associated ray (Camera=Camera, Direct=Controller). |

### OnPointerClickDown

```c#
virtual abstract void OnPointerClickDown()
```
Called when a click is initiated.

### OnPointerClickUp

```c#
virtual abstract void OnPointerClickUp()
```
Called when click is finished.

### OnPointerEnter

```c#
virtual abstract void OnPointerEnter(
  RaycastResult raycastResult,
  bool isInteractive
)
```
Called when the pointer is facing a valid GameObject.

This can be a 3D or UI element.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `raycastResult` | The hit detection result for the object being pointed at. | | `isInteractive` | Value `true` if the object being pointed at is interactive. | |

### OnPointerExit

```c#
virtual abstract void OnPointerExit(
  GameObject previousObject
)
```
Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.

This is also called just before **OnInputModuleDisabled** previousObject will be null in this case.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `previousObject` | The object that was being pointed at the previous frame. | |

### OnPointerHover

```c#
virtual abstract void OnPointerHover(
  RaycastResult raycastResultResult,
  bool isInteractive
)
```
Called every frame the user is still pointing at a valid GameObject.

This can be a 3D or UI element.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `raycastResultResult` | The hit detection result for the object being pointed at. | | `isInteractive` | Value `true` if the object being pointed at is interactive. | |