# ProximityPrompt

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/ProximityPrompt/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/ProximityPrompt

An object that lets you prompt players to interact with an object in the 3D world.

## Properties

### ActionText

```luau
ProximityPrompt.ActionText: string = "Interact"
```

- Tags: Read capabilities: Input + UI

The action text shown to the user.

### ClickablePrompt

```luau
ProximityPrompt.ClickablePrompt: boolean = true
```

- Tags: Read capabilities: Input + UI

Whether the prompt can be activated by clicking/tapping on the prompt UI.

### Enabled

```luau
ProximityPrompt.Enabled: boolean = true
```

- Tags: Read capabilities: Input + UI

Whether or not this prompt should be shown.

### Exclusivity

```luau
ProximityPrompt.Exclusivity: Enum.ProximityPromptExclusivity = Enum.ProximityPromptExclusivity.OnePerButton
```

- Tags: Read capabilities: Input + UI

Used to customize which prompts can be shown at the same time.

### GamepadKeyCode

```luau
ProximityPrompt.GamepadKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonX
```

- Tags: Read capabilities: Input + UI

The gamepad button the player should press to trigger the prompt.

### HoldDuration

```luau
ProximityPrompt.HoldDuration: number = 0
```

- Tags: Read capabilities: Input + UI

The duration, in seconds, that the player must hold the button/key down to trigger the prompt.

### KeyboardKeyCode

```luau
ProximityPrompt.KeyboardKeyCode: Enum.KeyCode = Enum.KeyCode.E
```

- Tags: Read capabilities: Input + UI

The key the player should press to trigger the prompt.

### MaxActivationDistance

```luau
ProximityPrompt.MaxActivationDistance: number = 10
```

- Tags: Read capabilities: Input + UI

The maximum distance a Player's `character` can be from the [`ProximityPrompt`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) for the prompt to appear.

### MaxIndicatorDistance

```luau
ProximityPrompt.MaxIndicatorDistance: number = 0
```

- Tags: Read capabilities: Input + UI

The maximum distance at which a lightweight indicator for the prompt is shown, hinting at a nearby interaction before the player is close enough to trigger it.

### ObjectText

```luau
ProximityPrompt.ObjectText: string = ""
```

- Tags: Read capabilities: Input + UI

An optional property that determines the object name text shown to the user.

### RequiresLineOfSight

```luau
ProximityPrompt.RequiresLineOfSight: boolean = true
```

- Tags: Read capabilities: Input + UI

Whether the prompt is hidden if the path between the player's [`Camera`](https://rapi.sleaze.dev/classes/Camera.md) and object parented to the [`ProximityPrompt`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) is obstructed.

### Style

```luau
ProximityPrompt.Style: Enum.ProximityPromptStyle = Enum.ProximityPromptStyle.Default
```

- Tags: Read capabilities: Input + UI

The style of the prompt's UI.

### UIOffset

```luau
ProximityPrompt.UIOffset: Vector2 = Vector2.zero
```

- Tags: Read capabilities: Input + UI

The pixel offset applied to the prompt's UI.

### AutoLocalize

```luau
ProximityPrompt.AutoLocalize: boolean = true
```

- Tags: Read capabilities: Input + UI

Whether the prompt's [`ProximityPrompt.ActionText`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) and [`ProximityPrompt.ObjectText`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) will be localized according to the [`ProximityPrompt.RootLocalizationTable`](https://rapi.sleaze.dev/classes/ProximityPrompt.md).

### RootLocalizationTable

```luau
ProximityPrompt.RootLocalizationTable: LocalizationTable
```

- Tags: Read capabilities: Input + UI

A reference to a [`LocalizationTable`](https://rapi.sleaze.dev/classes/LocalizationTable.md) to be used to apply automated localization to this prompt's [`ProximityPrompt.ActionText`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) and [`ProximityPrompt.ObjectText`](https://rapi.sleaze.dev/classes/ProximityPrompt.md).

## Methods

### InputHoldBegin

```luau
ProximityPrompt:InputHoldBegin()
```

- Tags: Capabilities: Input + UI

Fires a signal indicating that the user began pressing the prompt GUI button.

### InputHoldEnd

```luau
ProximityPrompt:InputHoldEnd()
```

- Tags: Capabilities: Input + UI

Fires a signal indicating that the user ended pressing the prompt GUI button.

## Events

### ButtonHoldBeganActionReplicated

```luau
ProximityPrompt.ButtonHoldBeganActionReplicated: RBXScriptSignal<(player: Player)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Input + UI

### ButtonHoldEndedActionReplicated

```luau
ProximityPrompt.ButtonHoldEndedActionReplicated: RBXScriptSignal<(player: Player)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Input + UI

### IndicatorHidden

```luau
ProximityPrompt.IndicatorHidden: RBXScriptSignal<()>
```

- Tags: Capabilities: Input + UI

Fires on the client when a lightweight indicator for the prompt is no longer shown.

### IndicatorShown

```luau
ProximityPrompt.IndicatorShown: RBXScriptSignal<()>
```

- Tags: Capabilities: Input + UI

Fires on the client when a lightweight indicator for the prompt becomes visible.

### PromptButtonHoldBegan

```luau
ProximityPrompt.PromptButtonHoldBegan: RBXScriptSignal<(playerWhoTriggered: Player)>
```

- Tags: Capabilities: Input + UI

Triggered when a player begins holding down the `key`/button connected to a prompt with a non-zero [`ProximityPrompt.HoldDuration`](https://rapi.sleaze.dev/classes/ProximityPrompt.md).

### PromptButtonHoldEnded

```luau
ProximityPrompt.PromptButtonHoldEnded: RBXScriptSignal<(playerWhoTriggered: Player)>
```

- Tags: Capabilities: Input + UI

Triggers when the player ends holding down the button on a prompt with a non-zero [`ProximityPrompt.HoldDuration`](https://rapi.sleaze.dev/classes/ProximityPrompt.md).

### PromptHidden

```luau
ProximityPrompt.PromptHidden: RBXScriptSignal<()>
```

- Tags: Capabilities: Input + UI

Triggers when the `prompt` becomes hidden.

### PromptShown

```luau
ProximityPrompt.PromptShown: RBXScriptSignal<(inputType: Enum.ProximityPromptInputType)>
```

- Tags: Capabilities: Input + UI

Triggers when the `prompt` becomes visible.

### Triggered

```luau
ProximityPrompt.Triggered: RBXScriptSignal<(playerWhoTriggered: Player)>
```

- Tags: Capabilities: Input + UI

Triggered when the prompt `key`/button is pressed, or after a specified amount of time holding the button, if [`ProximityPrompt.HoldDuration`](https://rapi.sleaze.dev/classes/ProximityPrompt.md) is used.

### TriggeredActionReplicated

```luau
ProximityPrompt.TriggeredActionReplicated: RBXScriptSignal<(player: Instance)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Input + UI

### TriggerEnded

```luau
ProximityPrompt.TriggerEnded: RBXScriptSignal<(playerWhoTriggered: Player)>
```

- Tags: Capabilities: Input + UI

Triggers when `key`/button is released, for longer events where the user is required to hold down the button.

### TriggerEndedActionReplicated

```luau
ProximityPrompt.TriggerEndedActionReplicated: RBXScriptSignal<(player: Player)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Input + UI

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
