-
What do you want to achieve?
I want my proximity prompt to be usable/accessible on mobile platforms as well as PC. -
What is the issue?
The proximity prompt is usable via PC when I press the E key, but not when I attempt to click (via PC) or tap (via mobile) on it. I’ve created a custom proximity prompt using a BillboardGui (see image below), which I think might be related to the issue?
-
What solutions have you tried so far?
I’ve tried turning on and off the “ClickablePrompt” property of the Proximity Prompt… but otherwise I’m a bit stuck on what I should do.
Additional Info:
“PromptActions” Module Script (located in ReplicatedStorage)
local PromptAction = {}
function PromptAction.createAction(prompt, player)
prompt.Enabled = false
local parentName = prompt:FindFirstAncestorWhichIsA("Model").Name
local plr = game.Workspace:FindFirstChild(player.Name)
if parentName == "DoorC1" then
plr:WaitForChild("HumanoidRootPart").CFrame = workspace.Teleports:WaitForChild("CafeI").CFrame + Vector3.new(0,10,0)
elseif parentName == "DoorC2" then
plr:WaitForChild("HumanoidRootPart").CFrame = workspace.Teleports:WaitForChild("CafeO").CFrame + Vector3.new(0,10,0)
elseif parentName == "DoorSG1" then
plr:WaitForChild("HumanoidRootPart").CFrame = workspace.Teleports:WaitForChild("SmallGiftI").CFrame + Vector3.new(0,10,0)
elseif parentName == "DoorSG2" then
plr:WaitForChild("HumanoidRootPart").CFrame = workspace.Teleports:WaitForChild("SmallGiftO").CFrame + Vector3.new(0,10,0)
elseif parentName == "Espresso Machine" then
--insert espresso machine script
elseif parentName == "Oven" then
--insert oven script
elseif parentName == "SGCash" then
--insert Small Gift Trade script
elseif parentName == "Mirror" then
--insert Customize script
elseif parentName == "Crafting Table" then
--insert Crafting script
elseif parentName == "Mailbox" then
--insert FastTravel script
elseif parentName == "Ring" then
local plr = game.Workspace:FindFirstChild(player.Name)
plr:WaitForChild("HumanoidRootPart").CFrame = workspace.Ring.Part.CFrame + Vector3.new(0,10,0)
end
prompt.Enabled = true
end
return PromptAction
“Prompts” LocalScript (located in StarterPlayerScripts)
local PS = game:GetService("ProximityPromptService")
local PromptActions = require(game.ReplicatedStorage.PromptActions)
PS.PromptShown:Connect(function(prompt, inputType) --prompt, inputType is keyboard/touchpad
if prompt.Style == Enum.ProximityPromptStyle.Default then
return
end
local UI = prompt.BillboardUI
UI.Enabled = true
end)
PS.PromptHidden:Connect(function(prompt, inputType)
if prompt.Style == Enum.ProximityPromptStyle.Default then
return
end
local UI = prompt.BillboardUI
UI.Enabled = false
end)
PS.PromptTriggered:Connect(function(prompt, player)
if prompt.Style == Enum.ProximityPromptStyle.Default then
return
end
PromptActions.createAction(prompt, player)
end)
In short: How can I make it so the prompt is also clickable and/or useable via mobile devices? Is there something I’m doing wrong? Also, please LMK if you need more information! I’m happy to provide it!
Thank you for all of your help! <3