My game is supposed to have content filters on Xbox One, so that it meets the ESRB criteria.
However, as evident from this video, I’m doing something incorrectly, and thats really bad.
Is there a 100% fool-proof way to detect if a user is playing on an Xbox One?
This is what I’m doing at the moment
local keyBoardEnabled = userInput.KeyboardEnabled
if keyBoardEnabled then
return
end
while not userInput.GamepadEnabled do
userInput.GamepadConnected:wait()
end
There’s no method to check unfortunately. I’ve asked like twice for a method or property to be added so that I can configure my layouts better, but both times they’ve been shot down (I wish I remember the threads those were from).
Your code snippet is good, unless the person is on a mobile device…or the user hasn’t hooked up a keyboard just yet. In both scenarios, the code will yield indefinitely unless they hook up a gamepad controller to their device/pc.
I really wish we could have properties that match the selections we have on our game configuration page:
game.DeviceType = Console | PC | Mobile | Tablet (or something like this)
My point being this: We shouldn’t have to do hacky/messy things to try and guess the device the user is on when ROBLOX clearly has info on the user’s device. I don’t understand why we can’t have this information exposed to some high level degree.
This is a new hack that I’m about to try, but its unholy.
while not userInput.GamepadEnabled do
userInput.Changed:wait()
end
while not game:FindFirstChild("OneStatFrame",true) do
if not userInput.KeyboardEnabled then
break
end
wait(1)
end
Basically, FindFirstChild recursive doesn’t have any check for RobloxLocked, and there is a special frame in the RobloxGui that doesn’t exist unless the user is on Xbox One, called OneStatFrame.
This is kinda risky though, considering how frequently ROBLOX likes to change their UI. Ideally I could check the height of the screen, but I don’t know how consistent that is.
Yeah. I think you’re just gonna have to do some weird adhoc thing like this for now. Hopefully I can try to voice more about getting a property added to make this easier.