# Interactor component

## Functions

### 1. Activate/Deactivate

Works like any other component in Unreal Engine. If you deactivate the interactor, it will stop looking for interactables and not consume any more performance when it may not be required (like in a cutscene, scripted events, etc.)

<figure><img src="https://2523857298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkfcusXmYdv33CDQzNCZB%2Fuploads%2FcWgQEmUIbX9TurEHDCBM%2Fimage.png?alt=media&#x26;token=b0f8dd4e-b7d4-4000-b805-ba0fa86846d0" alt=""><figcaption></figcaption></figure>

### 2. On Found/Lost Interactable

Gets called when the player looks/looks away at an interactable, to get the same event in interactables use **"On Begin Focus"** and **"On End Focus"**

<figure><img src="https://2523857298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkfcusXmYdv33CDQzNCZB%2Fuploads%2FSqRLcUCD1YfSijaZXUjo%2Fimage.png?alt=media&#x26;token=458afae0-f615-485b-b9d4-3bda82c26b8c" alt=""><figcaption></figcaption></figure>

### 3. Begin/End Interact

Signals to the interactor component that the player wants to commit to an interaction. In setup we use an input action for this, but it could also be made to automatically interact with interactables.&#x20;

<figure><img src="https://2523857298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkfcusXmYdv33CDQzNCZB%2Fuploads%2FhDOj3fEN2HKhUrJ8fmVN%2Fimage.png?alt=media&#x26;token=2405da08-d4ae-446d-84b2-1c04ae3e9c5b" alt=""><figcaption></figcaption></figure>

## Properties

The interactor comes with properties that allow for dynamic interaction. Here is a table with all properties you can modify:

<table><thead><tr><th width="201">Property</th><th width="410">Description</th><th>Default Value</th></tr></thead><tbody><tr><td>Interaction Check Distance</td><td>How far should we check for interactable objects (in unreal units)</td><td>1000</td></tr><tr><td>Interaction Check Rate</td><td>How much time (in seconds) between interaction checks</td><td>0.1</td></tr><tr><td>Interaction Sphere Radius</td><td>If greater than 0, use a sphere instead of a line trace, specifies the radius of the interaction sphere trace (in unreal units)</td><td>0</td></tr></tbody></table>
