Milky Way
UE5 AR Marker App

Cross-Platform Game Modes

Writing our Blueprints

8. Creating AR Game Mode

In Unreal Engine, you typically use a custom AR_GameMode when building AR applications for Android and iOS to set up the core rules, behavior, and environment needed for augmented reality experiences. Like other Game Modes, our AR_GameMode defines the rules and flow of the experience or game. This may include defining who the player is, what happens when the game starts, and what actors get spawned. This is especially important when spawning AR sessions and trackable objects.

As we continue to develop this AR application in the future, the AR_GameMode can help us with the AR session lifecycle such as starting, pausing, and stopping. In addition to showing and displaying UI, notifications, 3D models, animations, and much more.

The Outliner Window Setup

With Unreal's default AR template, you should find a BP_ARGameMode defined for you. If you do not have one, in your Content Drawer, right click and create new Blueprint Class / Game Mode Base. Then, name your Blueprint BP_ARGameMode. Finally, make sure that in the Details panel, the Default Pawn Class is set to your AR Pawn, which in our case would be BP_ARPawn.

9. Cross-Platform Handling

Because we are designing for a mobile device, the scene will need to be preared for ARKit (iOS) or ARCore (Android) input. Since ARKit and ARCore have and are different APIs, Unreal Engine abstracts that with the ARSessionConfig and AR-specific actors/components.

Augmented Reality with Apple

Resources for creating AR applications for Apple devices.

Augmented Reality with Google

Resources for creating AR applications for Android devices.

Our AR_GameMode is helpful here in handling platform-specific beavior, configuring the ARSession, and bringing a consistent experience across platforms.

The Outliner Window Setup

Now we need to make sure we have all the settings configured correctly.

  1. Edit/ Project Settings / Map & Modes then navigate to the Default Maps tab and find Game Default Map where APK Packaging: Orientation should be Sensor Portrait or Portrait.
  2. Edit/ Project Settings / Engine Input set Default Touch Interface to None.
  3. If building to Android: Edit/ Project Settings / Platforms - Android and uncheck Support Vulkan
  4. If building to iOS: Edit/ Project Settings / Platforms - iOS / XCode Projects keep Modern XCode enabled by checking Modernized Xcode. Then, input your Apple Dev Account Team ID. Navigate to the iOS tab and input a Bundle Display Name and Bundle Name and check Supports Portrait Orientation.

Apple Developer

10. AR Plugins

If you are developing for Android, install the Google ARCore plugin. For iOS, install the Apple ARKit.

On this page