Open Asterune
ProximityPrompt

ProximityPrompt

Displays an interaction prompt near a parent part.

Creatable
Instance.new("ProximityPrompt")
Inherits
Instance
Replication
Standard

Behavior

ProximityPrompt displays ObjectText and ActionText when a player enters activation range. Triggered fires on the server when the player completes the interaction. Parent the prompt to a part.

Summary

Members21
Properties12
Methods3
Events6

Properties

ActionText

ProximityPrompt.ActionText: string = ""

The action label displayed by the prompt, such as "Open".

ClickablePrompt

ProximityPrompt.ClickablePrompt: boolean = true

Whether the prompt can be activated by pointer input.

Enabled

ProximityPrompt.Enabled: boolean = true

Whether the prompt is available for display and activation.

Exclusivity

The policy used when several proximity prompts compete for visibility or input.

GamepadKeyCode

ProximityPrompt.GamepadKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonA

The gamepad button used to activate the prompt.

HoldDuration

ProximityPrompt.HoldDuration: number = 0

The required hold time in seconds. A value of 0 activates on a press. PromptButtonHoldBegan and PromptButtonHoldEnded report hold state.

KeyboardKeyCode

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

The keyboard key used to activate the prompt.

MaxActivationDistance

ProximityPrompt.MaxActivationDistance: number = 10

The maximum distance from the parent part, in studs, at which the prompt appears.

ObjectText

ProximityPrompt.ObjectText: string = ""

The object label displayed beside ActionText, such as "Supply Crate".

RequiresLineOfSight

ProximityPrompt.RequiresLineOfSight: boolean = true

Whether geometry can occlude the prompt.

Style

The global lighting style.

UIOffset

ProximityPrompt.UIOffset: Vector2 = Vector2.new(0, 0)

The screen-space offset applied to the prompt interface.

Methods

GetExecutionGroup

ProximityPrompt:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

InputHoldBegin

ProximityPrompt:InputHoldBegin(): boolean

Begins the prompt's hold interaction from custom input code.

InputHoldEnd

ProximityPrompt:InputHoldEnd(): boolean

Ends the prompt's hold interaction from custom input code.

Events

PromptButtonHoldBegan

ProximityPrompt.PromptButtonHoldBegan: RBXScriptSignal

Fires when a player starts holding the activation input.

PromptButtonHoldEnded

ProximityPrompt.PromptButtonHoldEnded: RBXScriptSignal

Fires when the hold stops, whether it completed or was released early.

PromptHidden

ProximityPrompt.PromptHidden: RBXScriptSignal

Fires when the prompt becomes hidden, including when disabled or out of range.

PromptShown

ProximityPrompt.PromptShown: RBXScriptSignal

Fires when the prompt becomes visible to a player.

TriggerEnded

ProximityPrompt.TriggerEnded: RBXScriptSignal

Fires when the prompt's triggering interaction ends.

Triggered

ProximityPrompt.Triggered: RBXScriptSignal

Fires on the server when a player completes activation. Passes the player. If HoldDuration is greater than 0, the hold must finish first.

Inherited members

Inherited47

Example

Luau
-- Parent this prompt to the target Part.
local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Open"
prompt.HoldDuration = 0.5

ClickDetector · BasePart · Player