Roblox Wiki
Advertisement
Roblox Wiki

The ProximityPrompt class inherits from Instance. This class was added in version 0.454.

Properties

Pubfield.gif string ActionText

The action text shown to the user.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif bool AutoLocalize

  • Category: Localization.
  • Serialization: can save and load.

Pubfield.gif bool ClickablePrompt

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif bool Enabled

When false, this prompt will not be shown, and events will not fire.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif ProximityPromptExclusivity Exclusivity

Describes which prompts will be shown when multiple may be visible.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif KeyCode GamepadKeyCode

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

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif float HoldDuration

The user must hold the button down for this duration to trigger the prompt.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif KeyCode KeyboardKeyCode

The key the player should press to trigger the prompt.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif float MaxActivationDistance

The maximum distance a Player's character can be from the ProximityPrompt for the prompt to appear.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif string ObjectText

The object name text shown to the user.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif bool RequiresLineOfSight

If true, this prompt will only be shown if there is a clear path from the camera to the object.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif LocalizationTable RootLocalizationTable

  • Category: Localization.
  • Serialization: can save and load.

Pubfield.gif ProximityPromptStyle Style

When set to custom, no default UI will be provided.

  • Category: Data.
  • Serialization: can save and load.

Pubfield.gif Vector2 UIOffset

a pixel offset applied to the UI.

  • Category: Data.
  • Serialization: can save and load.

Functions

Pubmethod.gif void InputHoldBegin()

Used to signal that the player began triggering this prompt.

Pubmethod.gif void InputHoldEnd()

Used to signal that the player ended triggering this prompt.

Events

Pubevent.gif PromptButtonHoldBegan(Player playerWhoTriggered)

Fired in local scripts when the user begins holding down the button on a prompt with a non-zero HoldDuration. This can be used to animate a progress bar.

Pubevent.gif PromptButtonHoldEnded(Player playerWhoTriggered)

Fired in local scripts when the user ends holding down the button on a prompt with a non-zero HoldDuration. This can be used to animate a progress bar.

Pubevent.gif PromptHidden()

Fired in local scripts when this prompt is hidden. Can be used for customization.

Pubevent.gif PromptShown(ProximityPromptInputType inputType)

Fired in local scripts when this prompt is shown. Can be used for customization.

Pubevent.gif TriggerEnded(Player playerWhoTriggered)

Pubevent.gif Triggered(Player playerWhoTriggered)

Fired when a player triggers the ProximityPrompt.

External links

Advertisement