On phones I’d like to move this button up a bit and make it smaller. On PC, I want to leave it where it is.
I’ve searching around a bit and I can’t find the definitive way to check if my player is running on a phone or not. There’s a bunch of hacks from 2016. How do I do it today?
Most solutions will probably be to check UserInputService.TouchEnabled and also ensure that there’s no mouse. That pretty much guarantees the existence of the jump button, and therefore lets you reposition accordingly.
He’s not saying you shouldn’t have device specific UI, he’s saying you should change it dynamically based on the last input rather than trying to figure out the device they’re on.
This makes sure that it will function on all devices properly as there’s no surefire way to check the specific device type.
Use this to check if the player has touch controls.
Sorry for bumping.
local touchGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("TouchGui")
if touchGui then
--has touch controls
else
--doesn't have touch controls
end