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 553 Enabled : bool 553 MaxPromptsVisible : int 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 ) 63 members inherited from Instance553 Archivable : bool 553 Attributes : string 553 AttributesReplicate : string 553 AttributesSerialize : BinaryString 635 Capabilities : SecurityCapabilities 553 DataCost : int 619 DefinesCapabilities : bool 553 HistoryId : UniqueId 553 Name : string 553 Parent : Instance 553 PropertyStatusStudio : PropertyStatus 553 RobloxLocked : bool 635 Sandboxed : bool 616 SourceAssetId : int64 553 Tags : BinaryString 616 UniqueId : UniqueId 553 archivable : bool 553 numExpectedDirectChildren : int 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 486 GetDescendants ( ) : Array 486 GetFullName ( ) : string 641 GetStyled ( name: string ) : Variant 576 GetTags ( ) : Array 576 HasTag ( tag: string ) : bool 486 IsAncestorOf ( descendant: Instance ) : bool 486 IsDescendantOf ( ancestor: Instance ) : bool 580 IsPropertyModified ( name: string ) : bool 573 Remove ( ) : null 576 RemoveTag ( tag: string ) : null 580 ResetPropertyToDefault ( name: string ) : null 573 SetAttribute ( attribute: string , value: Variant ) : null 462 WaitForChild ( childName: string , timeOut: double ) : Instance 648 children ( ) : Instances 553 clone ( ) : Instance 573 destroy ( ) : null 553 findFirstChild ( name: string , recursive: bool = false ) : Instance 648 getChildren ( ) : Instances 553 isDescendantOf ( ancestor: Instance ) : bool 573 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 ( ) 553 childAdded ( child: Instance ) 6 members inherited from Object647 ClassName : string 647 className : string 647 GetPropertyChangedSignal ( property: string ) : RBXScriptSignal 647 IsA ( className: string ) : bool 650 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.
553
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 4 This property indicates the maximum number of
ProximityPrompts that will be shown to the player.
History 4 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