ARCore Developer Preview 2 is now available. See the blog post for more information.

Getting Started with Unreal

Setting up your development environment

  • Build Unreal Engine 4.18 with the GoogleARCore plugin from source code by following these steps:

    • Gain access to Epic's GitHub repository.

    • Clone the google-ar-unreal repo with the following command:

      git clone -b 4.18-arcore-sdk-preview2 \
      https://github.com/google-ar-unreal/UnrealEngine.git

      Alternatively, developers with an existing Unreal Engine 4.18.2 repo can merge the 4.18-arcore-sdk-preview2 branch to their own branch with the following commands:

      # Checkout your target branch, which must be based on Unreal 4.18.2
      git checkout <target-branch>

      # Add google-ar-unreal as a remote git remote add google-ar-unreal https://github.com/google-ar-unreal/UnrealEngine.git

      # Fetch and merge the arcore branch git fetch google-ar-unreal 4.18-arcore-sdk-preview2 git merge google-ar-unreal/4.18-arcore-sdk-preview2

    • Build Unreal Engine from source.

      • Make sure to choose your operating system in the first step.
      • Prevent setup from overwriting the included Google ARCore binary files with the older files provided by Epic. Select n when you see Would you like to overwrite your changes (y/n)?.
  • Set up the Unreal editor for Android development by following the Android Quick Start.

    Make sure you install Android SDK Platform version 7.0 (API level 24) or higher.

  • You will need to get the Unreal HelloAR sample project. You can either:

    • Download the sample project repository and extract it.

      -or-

    • Clone the repository with the following command:

      git clone https://github.com/google-ar/arcore-unreal-sdk.git

  • You will need a supported Android device.

Prepare your device

You must use a supported, physical device. ARCore does not support virtual devices such as the Android Emulator. To prepare your device:

Open the sample project

In Unreal Editor open the HelloAR sample project.

Set up Android development settings

  1. In the menu bar, click Edit > Project Settings.

  2. In Project Settings, under the Android SDK platform, make sure all the paths are set correctly to your Android SDK and Android NDK installations. Set the SDK API Level to 'matchndk'. Then set the NDK API Level to android-24 or higher.

Build and run the sample app

  1. Package the HelloAR project. In the menu bar, select File > Package Project > Android > Android (ASTC).

    A dialog box will appear. In that box, create a new folder called Builds and click Select.

  2. Unreal begins packaging the project and displays the progress in the status window (lower right-hand corner). For details on the packaging process, see the Output Log window.

  3. Once the project has been packaged, make sure your device is connected to your machine. Open the Builds folder and double-click the file Install_HelloARUnreal_Development-armv7-es2.bat (if you are using Windows) or Install_HelloARUnreal_Development-armv7-es2.command (if you are using Mac) file to install the project on your Android Smartphone.

  4. After the install is completed, look for an app called HelloAR UE4 on your device and launch it.

As you move your device, the app automatically detects flat surfaces and draws a diamond grid. Tap the grid to place an Android robot on the surface.

Next Steps

Read the code in the sample app and ARCore for Unreal API reference.

Enviar comentarios sobre…