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.
This event triggers client-side in connected local scripts when the
indicator for a ProximityPrompt is no longer visible, such as when
the player moves outside the prompt's
MaxIndicatorDistance or the
prompt is disabled. It is the counterpart to
IndicatorShown and is
convenient for tearing down custom indicator UI globally rather than
connecting to each individual ProximityPrompt.
This event triggers client-side in connected local scripts when the
indicator for a ProximityPrompt becomes visible, which happens
when the player moves within the prompt's
MaxIndicatorDistance but
remains outside its
MaxActivationDistance.
Indicators are opt-in: a prompt only shows one when its
MaxIndicatorDistance is set
greater than 0 (the default of 0 disables the indicator). Listening on
the service rather than on each ProximityPrompt is convenient when
implementing custom indicator UI globally.
This property sets the maximum number of prompt indicators that can be
visible at the same time. Indicators are lightweight distance hints shown
for ProximityPrompts when the player is within the
prompt's MaxIndicatorDistance
but still outside its
MaxActivationDistance.
This property defaults to 16 and is clamped to the range [0, 64].
Because indicators are opt-in per prompt — a prompt's
MaxIndicatorDistance defaults
to 0, which disables its indicator — this property has no visible effect
unless at least one prompt sets a non-zero
MaxIndicatorDistance.
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.
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.