Optionally Disable ProximityPrompt Event Optimisations

See bottom for TL;DR.

ProximityPrompts make it extremely easy for developers to implement proximity-based interactions to their experiences. However, due to the nature of how ProximityPrompts are supposed to be used, PromptShown events are only fired when the centre of the part/attachment is physically visible on screen.

I would like to propose that Roblox are a property to optionally disable the optimisation that prevents this event from firing when the user is close enough, but not facing the prompt object.

I noticed this behaviour shortly after prompts were released, when I made use of “invisible” prompts (setting the appearance to “Custom,” but not binding a custom UI to the object) to create triggers for doors in my experience, so that they would open/close depending on whether the user was close enough.

And while this works great when the user is facing the door, it doesn’t work at all if the user isn’t, meaning the only way to pull this off is to continue using RunService events or loops to check a character’s proximity to the door.

Up until now, I accepted the consequences of using ProximityPrompts for this purpose, as I completely understand that it’s not what they were designed for, and it was an optimisation to prevent the required events from firing if the user isn’t able to see the UI anyway; however, I have recently discovered that I am no longer the only one using ProximityPrompts for this purpose, and the user in the linked post (@PersonifiedPizza) seems to have some interest for their system.

Now that others are realising the potential for non-UI based ProximityPrompt uses, I feel it would be apt to add a toggle to allow the optimisations to be disabled. This will allow developers to use ProximityPrompts for more than just displaying interaction prompts.


TL;DR

ProximityPrompts don’t fire PromptShown events if they’re not visible on screen. This is an optimisation added to prevent unnecessary events from firing if the user wouldn’t usually be able to see the interaction UI.

I’d like Roblox to add a property that allows this optimisation to be disabled, to allow developers to create proximity-based events which don’t necessarily require a UI to interact with.

6 Likes

Proximity Prompts simply need to be decoupled from the proximity sensing behavior. It’s absolutely silly that Roblox has decided we needed player proximity sensing API baked into a system meant specifically for showing prompts, and not any other processing. Proximity Prompts should be a system built on top of a proximity service, this off-screen behavior of proximity prompts does not make any sense for a general purpose proximity sensing service, and is only relevant to proximity prompts.

This option does not make any sense to provide for proximity prompts and is API clutter. If the proximity functionality was split from the prompt functionality, this optimization would simply be implemented on top of the prompt functionality, and no option for this would be necessary.

15 Likes