Allows developers to interact with ProximityPrompt objects in a global
way.
It is a singleton that may be acquired with GetService.
It is not visible in Studio's object browser.
Tags: [Service, NotBrowsable]
History Member 726 Enabled : bool 726 MaxIndicatorsVisible : int 726 MaxPromptsVisible : int 685 IndicatorHidden ( prompt: ProximityPrompt ) 685 IndicatorShown ( prompt: ProximityPrompt ) 483 PromptButtonHoldBegan ( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483 PromptButtonHoldEnded ( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483 PromptHidden ( prompt: ProximityPrompt ) 483 PromptShown ( prompt: ProximityPrompt , inputType: ProximityPromptInputType ) 483 PromptTriggerEnded ( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483 PromptTriggered ( prompt: ProximityPrompt , playerWhoTriggered: Player ) 60 members inherited from Instance726 Archivable : bool 726 Capabilities : SecurityCapabilities 726 DataCost : int 726 IsInSandbox : bool 726 Name : string 726 Parent : Instance 726 PredictionMode : PredictionMode 726 RobloxLocked : bool 726 Sandboxed : bool 726 SourceAssetId : int64 726 UniqueId : UniqueId 726 archivable : bool 576 AddTag ( tag: string ) : null 573 ClearAllChildren ( ) : null 462 Clone ( ) : Instance 573 Destroy ( ) : null 486 FindFirstAncestor ( name: string ) : Instance 486 FindFirstAncestorOfClass ( className: string ) : Instance 486 FindFirstAncestorWhichIsA ( className: string ) : Instance 486 FindFirstChild ( name: string , recursive: bool = false ) : Instance 486 FindFirstChildOfClass ( className: string ) : Instance 486 FindFirstChildWhichIsA ( className: string , recursive: bool = false ) : Instance 486 FindFirstDescendant ( name: string ) : Instance 563 GetActor ( ) : Actor 486 GetAttribute ( attribute: string ) : Variant 462 GetAttributeChangedSignal ( attribute: string ) : RBXScriptSignal 631 GetAttributes ( ) : Dictionary 648 GetChildren ( ) : Instances 462 GetDebugId ( scopeLength: int = 4 ) : string 707 GetDescendants ( ) : Instances 486 GetFullName ( ) : string 706 GetStyled ( name: string , selector: string? ) : Variant 657 GetStyledPropertyChangedSignal ( property: string ) : RBXScriptSignal 576 GetTags ( ) : Array 576 HasTag ( tag: string ) : bool 486 IsAncestorOf ( descendant: Instance ) : bool 486 IsDescendantOf ( ancestor: Instance ) : bool 664 IsPropertyModified ( property: string ) : bool 698 QueryDescendants ( selector: string ) : Instances 573 Remove ( ) : null 576 RemoveTag ( tag: string ) : null 664 ResetPropertyToDefault ( property: string ) : null 573 SetAttribute ( attribute: string , value: Variant ) : null 462 WaitForChild ( childName: string , timeOut: double ) : Instance 726 children ( ) : Instances 726 clone ( ) : Instance 726 destroy ( ) : null 726 findFirstChild ( name: string , recursive: bool = false ) : Instance 726 getChildren ( ) : Instances 726 isDescendantOf ( ancestor: Instance ) : bool 726 remove ( ) : null 462 AncestryChanged ( child: Instance , parent: Instance ) 462 AttributeChanged ( attribute: string ) 462 ChildAdded ( child: Instance ) 462 ChildRemoved ( child: Instance ) 462 DescendantAdded ( descendant: Instance ) 462 DescendantRemoving ( descendant: Instance ) 500 Destroying ( ) 657 StyledPropertiesChanged ( ) 726 childAdded ( child: Instance ) 6 members inherited from Object726 ClassName : string 726 className : string 647 GetPropertyChangedSignal ( property: string ) : RBXScriptSignal 647 IsA ( className: string ) : bool 726 isA ( className: string ) : bool 647 Changed ( property: string )
ProximityPromptService allows developers to interact with
ProximityPrompt objects in a global way. It may be more convenient to
listen to events through this service rather than on individual
ProximityPrompt objects.
726
Change Default of MaxPromptsVisible
from
16
to
726
Change Default of MaxIndicatorsVisible
from
16
to
726
Change Default of Enabled
from
true
to
685
Add IndicatorShown685
Add IndicatorHidden685
Add MaxIndicatorsVisible553
Change Default of MaxPromptsVisible
from
to
16 553
Change Default of Enabled
from
to
true 486
Change ThreadSafety of MaxPromptsVisible
from
ReadOnly
to
ReadSafe 486
Change ThreadSafety of Enabled
from
ReadOnly
to
ReadSafe 483
Change Parameters of PromptTriggered
from
( prompt: Instance , playerWhoTriggered: Instance )
to
( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483
Change Parameters of PromptTriggerEnded
from
( prompt: Instance , playerWhoTriggered: Instance )
to
( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483
Change Parameters of PromptShown
from
( prompt: Instance , inputType: ProximityPromptInputType )
to
( prompt: ProximityPrompt , inputType: ProximityPromptInputType ) 483
Change Parameters of PromptHidden
from
( prompt: Instance )
to
( prompt: ProximityPrompt ) 483
Change Parameters of PromptButtonHoldEnded
from
( prompt: Instance , playerWhoTriggered: Instance )
to
( prompt: ProximityPrompt , playerWhoTriggered: Player ) 483
Change Parameters of PromptButtonHoldBegan
from
( prompt: Instance , playerWhoTriggered: Instance )
to
( prompt: ProximityPrompt , playerWhoTriggered: Player ) 462
Change ThreadSafety of PromptTriggered
from
to
Unsafe 462
Change ThreadSafety of PromptTriggerEnded
from
to
Unsafe 462
Change ThreadSafety of PromptShown
from
to
Unsafe 462
Change ThreadSafety of PromptHidden
from
to
Unsafe 462
Change ThreadSafety of PromptButtonHoldEnded
from
to
Unsafe 462
Change ThreadSafety of PromptButtonHoldBegan
from
to
Unsafe 462
Change ThreadSafety of MaxPromptsVisible
from
to
ReadOnly 462
Change ThreadSafety of Enabled
from
to
ReadOnly 458
Change Parameters of PromptButtonHoldEnded
from
( prompt: Instance )
to
( prompt: Instance , playerWhoTriggered: Instance ) 458
Change Parameters of PromptButtonHoldBegan
from
( prompt: Instance )
to
( prompt: Instance , playerWhoTriggered: Instance ) 454
Add PromptTriggered454
Add PromptTriggerEnded454
Add PromptShown454
Add PromptHidden454
Add PromptButtonHoldEnded454
Add PromptButtonHoldBegan454
Add MaxPromptsVisible454
Add Enabled454
Add ProximityPromptServiceThis property determines whether ProximityPrompts
are enabled, and therefore shown, in-experience. When false, no prompts
will be shown.
For example, in a round-based system, you can disable prompts at certain
points in the experience to disable proximity-based interactions:
1
2
3
4
5
6
7
8
9
local ProximityPromptService = game : GetService ( "ProximityPromptService" )
local ReplicatedStorage = game : GetService ( "ReplicatedStorage" )
local enablePrompts = ReplicatedStorage : FindFirstChild ( "EnablePrompts" ) -- BindableEvent
-- Connect to the BindableEvent and fire from another script controlling experience logic
enablePrompts.OnServerEvent : Connect ( function ( enabled )
ProximityPromptService.Enabled = enabled
end )
History 5 This property indicates the maximum number of
ProximityPrompts that will be shown to the player.
History 5 This event triggers client-side in connected local scripts when a prompt
becomes hidden.
History 3 This event triggers client-side in connected local scripts when a prompt
becomes visible.
History 3 This event triggers when the player stops holding down the
KeyboardKeyCode key/button while
triggering a prompt. This is intended to allow interactions which require
the player to hold a key/button while something happens in-experience.
History 3 This event triggers when the player completes interaction with a prompt,
either when the KeyboardKeyCode
key/button is pressed, or after a specified amount of time holding the
key/button if the prompt's
HoldDuration is non-zero.
History 3