# How to detect the device type in UnrealScript?

How can I recognize if the player device is an iPad or an iPhone?

Now I can do it by checking the viewport size. But I think is just a tricky way, is there any other, more standard way?

• I guess Screen Resolution size is the only way rite now to differentiate the hardware – ammar26 Oct 22 '12 at 5:15

To detect what platform you're runnning on from UnrealScript, you'd typically use:

if( class'WorldInfo'.static.IsConsoleBuild(CONSOLE_Something) )
{
// do something platform-specific
}


Unfortunately, Unreal doesn't make a distinction between the different kinds of iOS devices (they're all CONSOLE_IPhone), so you're out of luck.

Also, when submitting an app to the Apple Store, you only have one build for all devices: you won't be able to do it manually by making two different builds.

This is probably for a very good reason (Apple trying to keep compatibility between device types and iterations?), so double check that you really want to make a distinction. And if it's really the case, yes, you'll have to use some heuristic of yours, such as the display resolution.