You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
for the proxyprompt Style to be “Default” for mobile users -
What is the issue? Include screenshots / videos if possible!
Proxyprompt shows up as default in studio when testing on mobile devices. But testing ingame on a mobile device it does not show up -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
First tried looking for a solution for custom proxy prompts with mobile but wasnt able to find something that works with the style i’ve created. I then moved onto what appeared to be working, having a separate script inside the proxy prompt that sets the style to default.
local UserInputService = game:GetService("UserInputService")
if UserInputService.TouchEnabled then
script.Parent.Style = "Default"
end
Im wondering why this works in studio with the “device test” set to a mobile phone but on a mobile device it does not work.
For anyone curious this is the local script that handles the custom proxyprompts, but this will not work on mobile cause theres no option to tap the proxyprompt
repeat wait() until game.Loaded
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
game:GetService("RunService").RenderStepped:Connect(function()
if UserInputService.TouchEnabled then
script.Enabled = false
else
if mouse.Target ~= nil then
local pos = mouse.Target.Position
local pos2 = player.Character.PrimaryPart.Position
if mouse.Target.Name == "wallbuy" then
if (pos - pos2).Magnitude <= 8 then
if player.Character.WeaponHandler.Primary.value == mouse.Target.ProximityPrompt.Item.Value then
player.PlayerGui.Prompts.BuyAmmo.Visible = true
player.PlayerGui.Prompts.BuyAmmo.buy.Text = "Press [F] to buy Ammo"
player.PlayerGui.Prompts.BuyAmmo.price.Text = mouse.Target.ProximityPrompt.AmmoPrice.Value
else
player.PlayerGui.Prompts.BuyGun.Visible = true
player.PlayerGui.Prompts.BuyGun.buy.Text = "Press [F] to buy "..mouse.Target.ProximityPrompt.Item.Value
player.PlayerGui.Prompts.BuyGun.price.Text = mouse.Target.ProximityPrompt.Price.Value
end
else
player.PlayerGui.Prompts.BuyGun.Visible = false
player.PlayerGui.Prompts.BuyAmmo.Visible = false
end
else
player.PlayerGui.Prompts.BuyGun.Visible = false
player.PlayerGui.Prompts.BuyAmmo.Visible = false
end
if mouse.Target.Name == "MeshPart" then
if (pos - pos2).Magnitude <= 8 then
if mouse.Target.Parent.Name == "pap" then
player.PlayerGui.Prompts.Buyperk.Visible = true
player.PlayerGui.Prompts.Buyperk.buy.Text = "Press [F] to Pack a Punch weapon"
player.PlayerGui.Prompts.Buyperk.price.Text = mouse.Target.ProximityPrompt.Price.Value
else
player.PlayerGui.Prompts.Buyperk.Visible = true
player.PlayerGui.Prompts.Buyperk.buy.Text = "Press [F] to buy "..mouse.Target.ProximityPrompt.Item.Value
player.PlayerGui.Prompts.Buyperk.price.Text = mouse.Target.ProximityPrompt.Price.Value
end
else
player.PlayerGui.Prompts.Buyperk.Visible = false
end
else
player.PlayerGui.Prompts.Buyperk.Visible = false
end
if mouse.Target.Name == "MainTurret" then
if (pos - pos2).Magnitude <= 8 then
player.PlayerGui.Prompts.Buytrap.Visible = true
player.PlayerGui.Prompts.Buytrap.buy.Text = "Press [F] to buy Trap"
player.PlayerGui.Prompts.Buytrap.price.Text = mouse.Target.ProximityPrompt.Price.Value
else
player.PlayerGui.Prompts.Buytrap.Visible = false
end
else
player.PlayerGui.Prompts.Buytrap.Visible = false
end
if mouse.Target.Name == "MainWunder" then
if (pos - pos2).Magnitude <= 8 then
player.PlayerGui.Prompts.BuyFizz.Visible = true
player.PlayerGui.Prompts.BuyFizz.buy.Text = "Press [F] to buy WunderFizz"
player.PlayerGui.Prompts.BuyFizz.price.Text = mouse.Target.ProximityPrompt.Price.Value
player.PlayerGui.Prompts.BuyFizz.Take.Text = "Press [F] to take Perk"
else
player.PlayerGui.Prompts.BuyFizz.Visible = false
end
else
player.PlayerGui.Prompts.BuyFizz.Visible = false
end
if mouse.Target.Name == "Barrier" then
if (pos - pos2).Magnitude <= 8 then
player.PlayerGui.Prompts.Repair.Visible = true
else
player.PlayerGui.Prompts.Repair.Visible = false
end
else
player.PlayerGui.Prompts.Repair.Visible = false
end
if mouse.Target.Name == "Box" then
if (pos - pos2).Magnitude <= 8 then
player.PlayerGui.Prompts.BuyBox.Visible = true
player.PlayerGui.Prompts.BuyBox.buy.Text = "Press [F] to buy Mysterybox"
player.PlayerGui.Prompts.BuyBox.price.Text = "$950"
player.PlayerGui.Prompts.BuyBox.Take.Text = game.Workspace.Map.Normal["Mystery Box"].GunGiven.Value
else
player.PlayerGui.Prompts.BuyBox.Visible = false
end
else
player.PlayerGui.Prompts.BuyBox.Visible = false
end
if mouse.Target.Name == "DoorPart" then
if (pos - pos2).Magnitude <= 8 then
player.PlayerGui.Prompts.BuyDoor.Visible = true
player.PlayerGui.Prompts.BuyDoor.buy.Text = "Press [F] to buy Door"
player.PlayerGui.Prompts.BuyDoor.price.Text = mouse.Target.ProximityPrompt.Price.Value
else
player.PlayerGui.Prompts.BuyDoor.Visible = false
end
else
player.PlayerGui.Prompts.BuyDoor.Visible = false
end
else
player.PlayerGui.Prompts.BuyGun.Visible = false
player.PlayerGui.Prompts.Repair.Visible = false
end
end
end)
Testing in studio
EDI:uploaded wrong video
Testing on my iPhone