Create Game with Unity using Assets

AR Camera GYRO

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).

Unity Asset Store | Download Button

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).

Package is a part of Unity Assets

  1. VR + AR: Mixed Reality (MR) (docs).
  2. AR Toss Boss (docs).
  3. AR Basketball GO.
  4. AR Survival Shooter (docs).
  5. AR Throwing (docs).

Package Contains

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

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 mobile gyroscope sensor.

Tested with Devices

Mobiles:

  • iOS on iPhone 6.
  • Android on Samsung Galaxy S7, Lenovo A606.

Tablets:

  • UWP on Microsoft Surface Pro 5, Acer Switch 5.

Tutorial

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

I used Unity 2018.3 & iOS 12 for this tutorial.
But you can also build it for Android.

  1. Create New Unity Project.
  2. Import AR Camera GYRO (docs).
  3. Import Your Scene.
  4. Switch to a Target Platform.
  5. Open Your Scene.
  6. Prepare Your Scene.
    1. Create Game Object called “GameWorld” to conveniently move the environment of your scene.
    2. Move all environment into “GameWorld” Game Object.
    3. Delete the Main Camera.
    4. Drag new instances of prefabs into “GameWorld” Game Object: “ARDirectionalLight” & “ARGround”.
    5. Delete your “ground”, position and scale “ARGround” for AR Shadows.
    6. Delete your main Directional Light.
    7. Drag a new instance of prefab into the scene: “ARCameraGYRO”.
    8. Position & Rotate “GameWorld” Game Object so that the environment could be seen in the Game View.
  7. Customize Quality Settings.
    1. Edit > Project Settings > Quality > Default Quality > High.
    2. Pixel Light Count = 1.
    3. Realtime Reflection Probes  = false.
    4. Billboards Face Camera Position = false.
    5. Shadow Resolution = Very High Resolution.
    6. Shadow Projection = Close Fit.
    7. Shadow Distance = 400.
  8. Customize Player Settings.
    1. Bundle Identifier = your.own.name.
    2. Camera, Location & Microphone descriptions > Any.
    3. Target minimum iOS Version > convenient for your phone.
  9. Build And Run.
  10. If you faced the problem in Xcode then indicate your Team for successfully deploying.
  11. Enjoy.

Script Manual

AR Camera GYRO prefab & GyroCameraControl.cs

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

Gyro Camera

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

Option: On Gyro Is Not Supported

You can assign a function (in the inspector) to be executed if the gyroscope is not supported by your smartphone. By default, you will see screen message: “Your device does not support gyroscope”.

Option: Is Gyro Disabled On Destroy

If it’s ‘true’ then Gyro’s “Y” Rotation is resetted on Scene Closing or Reloading.

Gyro

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

Gyro Supported

Is a gyroscope available on the device?

Rotation Fix
It corrects gyroscope rotation every Update () call.

Known issues

Unity AR bugs: Gyroscope

  1. Fixed in Unity 2018.2: INPUT.GYRO is extremely laggy on Samsung Galaxy S6, S6 Edge and S8 with Android 7.0.
  2. Fixed in Unity 2017.2: INPUT.GYRO.ATTITUDE returns acceleration’s values.
  3. Hardware Issue: INPUT.GYRO.ATTITUDE returns zero values on Motorola Moto G4 and G5.

Your actions

Vote on these issues and comment them.
It’s important for Unity Team, so users should pay them 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.2:

  • Optional Flag: “Is Gyro Disabled On Destroy”. If it’s ‘true’ then Gyro’s “Y” Rotation is resetted on Scene Closing or Reloading.
  • Unity Event “On Gyro Is Not Supported”, so 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”.

3.1:

  • Unity 2019.1 version;

3.0:

  • Unity 2018.3 version;
  • AR Shadow 1.3 version (docs);
  • Fix low FPS in Unity Editor;
  • 2 modes with Auto Rotation: Portrait, Landscape.

2.0:

  • ARCameraGYRO prefab (with all stuff inside);
  • AR Shadow (docs) (Without Vuforia packages);
  • Publisher Window (docs);
  • Unity 2017.3.1;
  • AR Background => as independent module;
  • New Docs;
  • GyroCameraControl.cs not related with GameWorld GameObject.

Support for Unity Assets
I am Andrew Sirota, Founder at Makaka Games and full-time Publisher on Unity Asset Store. First of all, read the latest docs online. If it didn’t help, get the support.
Related Articles
Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Spelling error report

The following text will be sent to our editors: