Skip to content

ProximityPrompt

Not yet Class Other

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

Not implemented yet

The modern interaction prompt is not implemented.

Workaround: Use a ClickDetector for interaction, plus a BillboardGui or hint label for the prompt.

0 Nova members · 31 modern Roblox members not implemented yet

Description

The ProximityPrompt instance lets you prompt players to interact with an object in the 3D world, such as opening a door or picking up an item. A ProximityPrompt object works when parented to a BasePart, Attachment, or Model (with PrimaryPart set) in the workspace. When the player's character approaches, a UI appears to prompt them for input.

Prompts consist of three primary elements, each of which can be controlled by the noted properties. The default UI can be swapped out for your own custom appearance as outlined in Style.

Property Description Default
Class.ProximityPrompt.ObjectText|ObjectText An optional name for the object being interacted with.
Class.ProximityPrompt.ActionText|ActionText An optional action name shown to the player. Interact
Class.ProximityPrompt.KeyboardKeyCode|KeyboardKeyCode The keyboard key which will trigger the prompt. E
Class.ProximityPrompt.GamepadKeyCode|GamepadKeyCode The gamepad button which will trigger the prompt. ButtonX

You can connect to proximity prompt events either on the ProximityPrompt object itself or globally through ProximityPromptService. The ProximityPromptService allows you to manage all proximity prompt behavior from one location, preventing any need for duplicate code in your experience.

For more information regarding proximity prompts, see the Proximity Prompts guide.

Inheritance

Object → Instance → ProximityPrompt

Properties

Member Signature Summary
ActionText ActionText: string The action text shown to the user.
AutoLocalize AutoLocalize: bool Whether the prompt's ProximityPrompt.ActionText and ProximityPrompt.ObjectText will be localized accord…
ClickablePrompt ClickablePrompt: bool Whether the prompt can be activated by clicking/tapping on the prompt UI.
Enabled Enabled: bool Whether or not this prompt should be shown.
Exclusivity Exclusivity: ProximityPromptExclusivity Used to customize which prompts can be shown at the same time.
GamepadKeyCode GamepadKeyCode: KeyCode The gamepad button the player should press to trigger the prompt.
HoldDuration HoldDuration: float The duration, in seconds, that the player must hold the button/key down to trigger the prompt.
KeyboardKeyCode KeyboardKeyCode: KeyCode The key the player should press to trigger the prompt.
MaxActivationDistance MaxActivationDistance: float The maximum distance a Player's character can be from the ProximityPrompt for the prompt to appear.
MaxIndicatorDistance MaxIndicatorDistance: float 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 ObjectText: string An optional property that determines the object name text shown to the user.
RequiresLineOfSight RequiresLineOfSight: bool Whether the prompt is hidden if the path between the player's Camera and object parented to the ProximityPrompt is obstructed.
RootLocalizationTable RootLocalizationTable: LocalizationTable A reference to a LocalizationTable to be used to apply automated localization to this prompt's [ProximityPrompt.ActionText](ProximityPrompt.md#ac…
Style Style: ProximityPromptStyle The style of the prompt's UI.
UIOffset UIOffset: Vector2 The pixel offset applied to the prompt's UI.

Methods

Member Signature Summary
InputHoldBegin ProximityPrompt:InputHoldBegin(): null Fires a signal indicating that the user began pressing the prompt GUI button.
InputHoldEnd ProximityPrompt:InputHoldEnd(): null Fires a signal indicating that the user ended pressing the prompt GUI button.

Events

Member Signature Summary
ButtonHoldBeganActionReplicated ButtonHoldBeganActionReplicated(player: Player) —
ButtonHoldEndedActionReplicated ButtonHoldEndedActionReplicated(player: Player) —
IndicatorHidden IndicatorHidden() Fires on the client when a lightweight indicator for the prompt is no longer shown.
IndicatorShown IndicatorShown() Fires on the client when a lightweight indicator for the prompt becomes visible.
PromptButtonHoldBegan PromptButtonHoldBegan(playerWhoTriggered: Player) Triggered when a player begins holding down the key/button connected to a prompt with a non-zero [ProximityPrompt.HoldDuration](Pro…
PromptButtonHoldEnded PromptButtonHoldEnded(playerWhoTriggered: Player) Triggers when the player ends holding down the button on a prompt with a non-zero ProximityPrompt.HoldDuration.
PromptHidden PromptHidden() Triggers when the prompt becomes hidden.
PromptShown PromptShown(inputType: ProximityPromptInputType) Triggers when the prompt becomes visible.
Triggered Triggered(playerWhoTriggered: Player) Triggered when the prompt key/button is pressed, or after a specified amount of time holding the button, if [ProximityPrompt.HoldDu…
TriggeredActionReplicated TriggeredActionReplicated(player: Instance) —
TriggerEnded TriggerEnded(playerWhoTriggered: Player) Triggers when key/button is released, for longer events where the user is required to hold down the button.
TriggerEndedActionReplicated TriggerEndedActionReplicated(player: Player) —

Roblox reference: ProximityPrompt

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.