What is the issue? Include screenshots / videos if possible!
Mobile user are unable to interact with custom proximity prompts. I did make sure to make the proxy’s clickable but mobile users are still unable to interact with the proxy prompts. I did try adding an invisible TextButton (seen below but “–” 'd out) but I think I may have formatted this incorrectly
local PromptServ = game:GetService("ProximityPromptService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local PlayerGui = Player.PlayerGui
local promptUI = PlayerGui:FindFirstChild("ProximityPrompts")
if not promptUI then
promptUI = Instance.new("ScreenGui")
promptUI.Name = "ProximityPrompts"
promptUI.Parent = PlayerGui
end
game:GetService("UserInputService").InputChanged:Connect(function(input,chat)
for i,v in pairs(game.Workspace:GetDescendants()) do
if v:IsA("ProximityPrompt") then
v.ClickablePrompt = input.UserInputType == Enum.UserInputType.Touch and true or false
end
end
end)
PromptServ.PromptShown:Connect(function(prompt,promptType, inputType)
if prompt.Style == Enum.ProximityPromptStyle.Default then
return
end
local billboardUI = script.Default:Clone()
billboardUI.Enabled = true
local PromptFrame = billboardUI:WaitForChild("PromptFrame")
local inputName = prompt.KeyboardKeyCode.Name
local takeOrBuy = "Take"
if promptType == Enum.ProximityPromptInputType.Gamepad then
inputName = prompt.GamepadKeyCode.Name
elseif promptType == Enum.ProximityPromptInputType.Touch then
inputName = "Tap"
--this is what i tried to add but it didnt work, lets players interact but then they can no longer move or do anything ? -- 9/22/24
--local button = Instance.new("TextButton")
--button.TextTransparency = 1
--button.BackgroundTransparency = 1
--button.Size = UDim2.fromScale(1,1)
--button.Parent = promptUI
--local buttonDown = false
--button.InputBegan:Connect(function(input)
-- if (input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1) and
-- input.UserInputState ~= Enum.UserInputState.Change then
-- prompt:InputHoldBegin()
-- buttonDown = true
-- end
--end)
--button.InputEnded:Connect(function(input)
-- if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
-- if buttonDown then
-- buttonDown = false
-- prompt:InputHoldEnd()
-- end
-- end
--end)
end
-- `<font color="rgb(225,225,0)">Tap</font> to repair Barrier`
PromptFrame.ActionText.Text = prompt.ActionText
PromptFrame.FakeText.Text = `<font color="rgb(225,225,0)"` .. ">" .. inputName .. "</font> to " .. takeOrBuy .. " " .. prompt.ActionText
PromptFrame.ObjectText.Text = prompt.ObjectText
billboardUI.Parent = promptUI
billboardUI.Adornee = prompt.Parent
billboardUI.Enabled = true
prompt.PromptHidden:Wait()
billboardUI:Destroy()
end)
any suggestions would be greatly appreciated. I am truly not sure why clickable is not working on the prompts but the textbutton i added did sorta work but then every UI button on the screen would not work. I think its cause the textbutton stays but im not really sure.
To add context, this is a local script within StarterCharacterScripts.