Hello!
I am trying to make a custom proximity prompt (eg. 1) that will work for PC, Mobile, and console.
Ideas?
eg. 1
Hello!
I am trying to make a custom proximity prompt (eg. 1) that will work for PC, Mobile, and console.
Ideas?
eg. 1
Roblox’s default proximity prompts already work for all devices, i don’t get what your trying to do… Unless you mean a custom proximity prompt, i recommend using roblox’s built in ones and changing the ui to your liking, there probably a youtube tutorial online, search “roblox proximity prompt custom ui tutorial” allot will popup.
Thanks for your response.
The reason I don’t use the default Roblox UI, is bc its trash.
And all the yt vids that I have seen aren’t mobile-friendly.
–
I have this so far
local UserInputService = game:GetService("UserInputService")
UserInputService.TouchTap:Connect(function()
print("touch")
end)
UserInputService.TouchStarted:Connect(function()
end)
UserInputService.TouchMoved:Connect(function()
end)
UserInputService.TouchEnded:Connect(function()
end)
UserInputService.TouchPan:Connect(function()
end)
I just need to check if the player is touching the prompt (not anywhere on the screen)
I think every is mobile friendly they just havent designed it to make the button a “Tap” icon for mobile users
Yeah, but I just need to check if the player is clicking on the prompt, bc my code below detects if they are clicking anywhere on the screen.
local UserInputService = game:GetService("UserInputService")
local promptButton = game.Workspace.Part1.PromptF.Frame.TextButton
local function onTouchBegan(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.UserInputType == Enum.UserInputType.Touch then
print("S")
end
end
end
local function onTouchEnded(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Touch then
print("E")
end
end
UserInputService.InputBegan:Connect(onTouchBegan)
UserInputService.InputEnded:Connect(onTouchEnded)
Why not do button.clicked or something? your surfacegui does have buttons right?
Yes, but it is a billboard gui, will that still work?
What do you mean? It’s pretty mobile-friendly as it has custom icons and a very smooth system for mobile.
However, if you still want to change it, I advise you to not create an entirely new system altogether, you can edit the ProximityPrompt to have a custom UI instead.
Yes. That is what I mean. I just need a way to detect when the mobile player clicks on the custom prompt.
You can still use the .Triggered
event in the ProximityPrompt
instance.
I would reccomend utilizing the Zone module!
Or you can utilize a touch event to adorn the guis.
You should either have them stored in the PlayerGui and handle the adorning of the interface with a type of targeting system based on mouse movement or distance from the player.
You can also make completely custom aesthetic proximity prompts using this script!
You simply change the attribute of the proximity prompts theme and it will change to that interface.
ProximityPromptScript - Roblox
Thank you so much for responding.
I have a few questions,
1: How might I use Zone module
2: How does the attached script work
Is there a yt vid or something that can help me understand?
Thanks
The easiest thing to use is the proximityprompt script you place it in the playersscript it replaces the default script which is very optimized. you add a theme attribute to your prompts and create the corresponding interface which is currently located inside the script. You can use any old prxomity prompt as a placeholder it will transform into the new interface by the value of the theme attribute inside the proximity prompt since it is handled locally.
This will allow you to fully customize the proximity prompts appearance while maintaining its functionality.
With the zone module you should read the documentation in community resources. But I do have a simple way to use it.
I have prepared a model and read me with a simple guide to use it.
It’s supposed to be a lot more performant than a hitbox and should basically simulate the functionality of being in the zone and outside it efficiently.
ZoneModule - Roblox
Not sure if you’re aware of this or not, but the ProximityPrompt API has support for implementing your own UI while maintaining the same functionality. I’d recommend this over trying to create your implementation.
I see. By chance, could you perhaps send the link to the ZoneModule documentation (as I can’t find it).
It appears that it on the top page of Community Resources Zone Module 3.2
you are doing way more work than you need to.
just use ProximityPromptService to swap the UI for you and it will still inherit all the default functionality you want. Use Enum.ProximityPromptStyle.Custom to hide the default UI and overlay your own
Yeah, I know that. But how on earth do I detect when the mobile player clicks the dang CUSTOM proximity prompt!?!?!