AR Camera GYRO — Unity Asset that uses camera and gyroscope on the player’s mobile device to display 2D or 3D objects as though they were in real world.

Cross-platform mobile gyroscopic camera implements markerless augmented reality (AR) by using a gyroscope sensor (like Pokemon GO).

AR Camera GYRO and ARKit, ARCore

There is no integration with ARKit & ARCore. Unity AR Camera GYRO operates with gyroscope without surface detection to cover a wider range of mobile devices than ARKit & ARCore.

Read more about Top AR Engines for Unity.

Features of AR Camera GYRO

Bring the enchanting Power of Augmented Reality into your amazing Game or App:

2 modes with Auto Rotation: Portrait, Landscape.

3-minute installation for your own AR Scene.

Same AR as in Pokemon GO game.

Covering a wide range of mobile devices.

No using of other AR Engines like ARCore, ARKit, Vuforia, etc.

Real-Time AR Shadows (docs).

Quick Testing in Unity Editor without Smartphone.

Package is a part of Unity Assets

Package Contains

All modules are designed independently to keep this asset extendable & easy to understand:

Demo with AR Shadow (docs).

Gyro vs. Accelerometer

90% of all mobile devices have an accelerometer and video camera but only 20% have a gyroscope.

If you want greater coverage of devices, but less accuracy and stability, use AR Camera ACCELEROMETER (docs).

If you want greater accuracy and stability, use AR Camera GYRO (docs).

You can also try to use both cameras for different cases.

Limitations

Different devices have different gyroscopes, and therefore different deviations and drifts.

Drift is natural for the mobile gyroscope sensor.

Tutorial

This tutorial is relevant for 3.3+ version of Asset.

Tutorials for previous versions can be found in asset folder.

Getting Started with AR Camera GYRO

Folders & Files in the package by default:

Makaka Games.

Steps

If you have any issues with the first launch then just Reach Support with Invoice Number and Get Help. If you read this tutorial from PDF, first check the latest docs online to get actual information.

Create a New Unity Project with Unity 2019.3.0. File > Build Settings > Switch to a Target Platform. Download and import AR Camera GYRO into Unity. Next Packages are provided with Unity Package Manager, and they are already installed for this Asset by default. If packages are missing (Warning Window has not appeared) then install them again with Unity Package Manager: TextMesh Pro 2.0.1: Always Required: Window > TextMeshPro > Import TMP Essential Resources; Customize Project Settings. Quality Settings: Edit > Project Settings > Quality > Default Quality > High. Pixel Light Count = 1. Realtime Reflection Probes = false. Billboards Face Camera Position = false. Shadow Resolution = Very High Resolution. Shadow Projection = Close Fit. Shadow Distance = 400. Player Settings: Bundle Identifier = your.own.name. Camera, Location & Microphone descriptions > “AR Mode”. iOS: Target minimum iOS Version > convenient for your phone. Open Scene: Makaka Games > AR > Camera GYRO > Scenes > Demo. Test in the Unity Editor with Unity Remote or Build for Mobile.

Useful Article: How to Test iOS App without Developer Account?

Video: How to transform your scene into Augmented Reality with AR Camera GYRO?

Prepare Unity Project as shown in the “Getting Started” chapter. Import Your Scene with Related Assets. Open Your Scene. Prepare Your Scene. Create a Game Object called “GameWorld” to conveniently move the environment of your scene. Move all environments into “GameWorld” Game Object. Delete the Main Camera. Drag new instances of prefabs into “GameWorld” Game Object: “ARDirectionalLight” with Rotation = (50, 25, 0); “ARGround” with X, Z scale you need. Delete your “ground”, position and scale “ARGround” for AR Shadows. Delete your main Directional Light. Drag a new instance of prefab into the scene: “ARCameraGYRO”. Position & Rotate “GameWorld” Game Object so that the environment could be seen in the Game View. Build And Run.

Script Manual

AR Camera GYRO prefab & GyroCameraControl.cs

ARCameraGYRO prefab has main camera control script: GyroCameraControl.cs.

Public

Gyro Camera

Gyroscope Camera for virtual world rotating depending on the gyro data.

Optional Flag: Is Gyro Disabled On Destroy

If it’s ‘true’ then Gyro’s “Y” Rotation is reset on Scene Closing or Reloading. Useful if you need to Control the Start Rotation of Camera when Restart.

Optional Event: On Gyro Is Not Supported

Here you can easily assign your own functions in case that smartphone doesn’t have the gyroscope. By default, you will see screen message: “Your device does not support gyroscope”.

Private

Gyro

Interface into the Unity Gyroscope. Use this variable to access the gyroscope.

Gyro Supported

Is a gyroscope available on the device?

Rotation Fix

It corrects the gyroscope rotation every Update () call.

Testing

There are 2 ways of testing without building an app:

Testing with Unity Remote & Smartphone connected to Computer.

Testing without a Smartphone.

Testing without the Smartphone

It’s a convenient way to frequently testing the same positions and rotations of the camera: “GyroCamera” Game Object. The phone does not need to be connected to the computer.

So you can save these data with custom Transform components on Game Objects as shown on the screenshot: as children of “TestViewWithoutGyro” Game Object.

These transform components are parameters for the function called SetPositionAndRotation (Transform transform) which is executed on game start when “OnGyroIsNotSupported” event is called (i.e. Unity Editor environment or Smartphone without Gyroscope).

Use Case

I used this testing method when developing AR Basketball GO (docs). I needed to periodically test Normal Ball (with touching of Ring) & Clear Ball (without touching of Ring). Since throw “Clear Ball” is a hard task, I saved 2 different camera Transform components to change them when needed:

Right Above the Ring; A Few Meters from the Ring.

Testing Time was decreased well because I didn’t need to take the mobile phone every time in my hands after changes in the game logic & move the phone manually. Instead of it, I had predefined data.

Tested with Devices

Mobiles:

iOS on iPhone 6, 8, XS Max.

Android on Samsung Galaxy S7, S10.

Tablets:

UWP on Microsoft Surface Pro 5, Acer Switch 5.

Known issues

Unity AR bugs: Gyroscope

Your actions

Vote on these issues and comment on them.

It’s important for Unity Team, so users should pay their attention to the situation.

Black screen on iOS

You just need to fill Camera Usage Description in Unity Editor.

Go to Unity Editor > Player Settings > iOS > Other Settings > Camera Usage Description > Fill it (any note for your app).

Support

First of all, read the latest docs online.

If it didn’t help, get the support.

Changelog

Check the current version on Asset Store.

The latest versions will be added as soon as possible.

3.3:

New Way of Testing in Unity Editor (On Gyro is not supported) with custom positions and rotations of camera. The phone does not need to be connected to the computer.

Tutorial Texts => TextMesh Pro.

Unity 2019.3.0.

3.2:

Optional Flag: “Is Gyro Disabled On Destroy”.

Optional Unity Event “On Gyro Is Not Supported”.

3.1:

Unity 2019.1.

3.0:

Unity 2018.3;

AR Shadow 1.3 (docs);

Fix low FPS in Unity Editor;

2 modes with Auto Rotation: Portrait, Landscape.

2.0: