Skip to content
Roblox API Reference

ProximityPrompt

An object that lets you prompt players to interact with an object in the 3D world.
Memory category
Instances
Own members
29
Inherited members
75
Subclasses
0
Siblings
608

Properties38

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byProximityPrompt15

Property categoryData

  • ProximityPrompt.ActionText: string = "Interact"
    The action text shown to the user.
    • Read capabilities: Input + UI
  • ProximityPrompt.ClickablePrompt: boolean = true
    Whether the prompt can be activated by clicking/tapping on the prompt UI.
    • Read capabilities: Input + UI
  • ProximityPrompt.Enabled: boolean = true
    Whether or not this prompt should be shown.
    • Read capabilities: Input + UI
  • Used to customize which prompts can be shown at the same time.
    • Read capabilities: Input + UI
  • ProximityPrompt.GamepadKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonX
    The gamepad button the player should press to trigger the prompt.
    • Read capabilities: Input + UI
  • ProximityPrompt.HoldDuration: number = 0
    The duration, in seconds, that the player must hold the button/key down to trigger the prompt.
    • Read capabilities: Input + UI
  • ProximityPrompt.KeyboardKeyCode: Enum.KeyCode = Enum.KeyCode.E
    The key the player should press to trigger the prompt.
    • Read capabilities: Input + UI
  • ProximityPrompt.MaxActivationDistance: number = 10
    The maximum distance a Player's character can be from the ProximityPrompt for the prompt to appear.
    • Read capabilities: Input + UI
  • ProximityPrompt.MaxIndicatorDistance: number = 0
    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.
    • Read capabilities: Input + UI
  • ProximityPrompt.ObjectText: string = ""
    An optional property that determines the object name text shown to the user.
    • Read capabilities: Input + UI
  • ProximityPrompt.RequiresLineOfSight: boolean = true
    Whether the prompt is hidden if the path between the player's Camera and object parented to the ProximityPrompt is obstructed.
    • Read capabilities: Input + UI
  • The style of the prompt's UI.
    • Read capabilities: Input + UI
  • ProximityPrompt.UIOffset: Vector2 = Vector2.zero
    The pixel offset applied to the prompt's UI.
    • Read capabilities: Input + UI

Property categoryLocalization

Methods44

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byProximityPrompt2
  • ProximityPrompt:InputHoldBegin()
    Fires a signal indicating that the user began pressing the prompt GUI button.
    • Capabilities: Input + UI
  • ProximityPrompt:InputHoldEnd()
    Fires a signal indicating that the user ended pressing the prompt GUI button.
    • Capabilities: Input + UI

Events22

Inherited fromObject1
Inherited fromInstance9
Defined byProximityPrompt12
  • ProximityPrompt.ButtonHoldBeganActionReplicated: RBXScriptSignal<(player: Player)>
    • Hidden
    • Roblox engine security
    • Capabilities: Input + UI
    Parameters
    Parameter
    player: Player
  • ProximityPrompt.ButtonHoldEndedActionReplicated: RBXScriptSignal<(player: Player)>
    • Hidden
    • Roblox engine security
    • Capabilities: Input + UI
    Parameters
    Parameter
    player: Player
  • ProximityPrompt.IndicatorHidden: RBXScriptSignal<()>
    Fires on the client when a lightweight indicator for the prompt is no longer shown.
    • Capabilities: Input + UI
  • ProximityPrompt.IndicatorShown: RBXScriptSignal<()>
    Fires on the client when a lightweight indicator for the prompt becomes visible.
    • Capabilities: Input + UI
  • ProximityPrompt.PromptButtonHoldBegan: RBXScriptSignal<(playerWhoTriggered: Player)>
    Triggered when a player begins holding down the key/button connected to a prompt with a non-zero ProximityPrompt.HoldDuration.
    • Capabilities: Input + UI
    Parameters
    Parameter
    playerWhoTriggered: Player
  • ProximityPrompt.PromptButtonHoldEnded: RBXScriptSignal<(playerWhoTriggered: Player)>
    Triggers when the player ends holding down the button on a prompt with a non-zero ProximityPrompt.HoldDuration.
    • Capabilities: Input + UI
    Parameters
    Parameter
    playerWhoTriggered: Player
  • ProximityPrompt.PromptHidden: RBXScriptSignal<()>
    Triggers when the prompt becomes hidden.
    • Capabilities: Input + UI
  • ProximityPrompt.PromptShown: RBXScriptSignal<(inputType: Enum.ProximityPromptInputType)>
    Triggers when the prompt becomes visible.
    • Capabilities: Input + UI
    Parameters
    Parameter
    inputType: Enum.ProximityPromptInputType
  • ProximityPrompt.Triggered: RBXScriptSignal<(playerWhoTriggered: Player)>
    Triggered when the prompt key/button is pressed, or after a specified amount of time holding the button, if ProximityPrompt.HoldDuration is used.
    • Capabilities: Input + UI
    Parameters
    Parameter
    playerWhoTriggered: Player
  • ProximityPrompt.TriggeredActionReplicated: RBXScriptSignal<(player: Instance)>
    • Hidden
    • Roblox engine security
    • Capabilities: Input + UI
    Parameters
    Parameter
    player: Instance
  • ProximityPrompt.TriggerEnded: RBXScriptSignal<(playerWhoTriggered: Player)>
    Triggers when key/button is released, for longer events where the user is required to hold down the button.
    • Capabilities: Input + UI
    Parameters
    Parameter
    playerWhoTriggered: Player
  • ProximityPrompt.TriggerEndedActionReplicated: RBXScriptSignal<(player: Player)>
    • Hidden
    • Roblox engine security
    • Capabilities: Input + UI
    Parameters
    Parameter
    player: Player