As an Associate of different 3rd parties, this website earns from qualifying purchases & contains affiliate links: learn more in the footer.

Camera Feed on Background — Unity Asset — Mobile Camera Stream — Device Camera

Camera Feed on Background — Unity Asset that uses Back/Rear or Front/Face Camera on the player’s mobile device to display the Live Video Input on the Background of the Scene. Safety First.

Unity Asset Store — Download Button

It doesn’t use any Motion Sensor of a Mobile Device (Gyroscope or Accelerometer) to rotate the Game World like in AR Camera Lite (docs) or in AR + VR: MR Camera (docs).

Note: The asset has a free external dependency.
Read the “Getting Started” Tutorial to Import it correctly.

Check out the Support section if you need help.

Features of Camera Feed

Bring the enchanting Power of Camera Feed into your amazing Game or App:

  • Cross-platform Camera Feed: iOS, Android.
  • Device Orientations: Portrait, Landscape.
  • Smartphone Cameras: Rear/Back, Front/Face/Selfie.
  • Button: Switch Camera (Back/Front).
  • Instant Launch after granting the camera permission.
  • Quick Testing in Unity Editor with Webcam.

Package Contains

  • Demo Scene with Camera Feed.
  • Menu Scene with Safety Tutorial.
  • Permission Scene with Camera Permission Request using free Native Camera.
  • Loading Screen to switch scenes seamlessly.

Check the Map of Unity Assets to choose the product that best suits your needs.


Limitations

Asset doesn’t operate with Native Code and relies on the WebCamTexture class.
Any possible Limitations are related to this class.

Use Cases

1. By adding rotation to the Game Camera using the Motion Sensor of a Mobile Device (Gyroscope or Accelerometer), the Camera Feed on Background can be used as a “Pseudo AR Camera” to display 2D or 3D objects as though they were in the real world.

This technique was implemented in AR Camera Lite (docs).


2. With integration of Google Cardboard XR Plugin, the Camera Feed on Background can be used as a Mixed Reality (MR) Camera. This idea was implemented in AR + VR: Mixed Reality Camera (docs).


3. Previous version of AR FPS Shooter (docs) used Pseudo AR mechanics that you can watch below.


Tutorial

This tutorial is relevant for Camera Feed on Background 3.0.
Tutorial for the previous version can be found only in the asset folder.

Getting Started with Camera Feed on the Background

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.

  1. Create a New Unity Project with Unity 6000.3.7 & “Universal 3D” Template.
  2. File > Build Profiles > Platforms > Android, iOS > Switch Platform.
  3. Next Packages must be manually installed with Git & Unity Package ManagerI recommend using indicated versions to get a guaranteed experience:
  4. Download and import the Camera Feed on Background into Unity.
  5. Window > TextMeshPro > Import TMP Essential Resources > Import.
  6. Reopen Unity Project.
  7. Open Scene: Makaka Games > CameraFeedOnBackground > Scenes > Demo.
  8. File > Build Profiles > Scene List > Add Scenes:
    • Menu,
    • Permission_Camera (from Makaka Games > Publisher > Permissions > Camera > Scenes),
    • LoadScreen (from Makaka Games > Publisher > SceneControl > Scenes),
    • Demo.
  9. Option: Limit the Screen Orientation from Auto (by default) to Portrait only or Landscape only by indication of appropriate Scene Loading Methods on the corresponding buttons that cause transitions to other scenes. Orientation in the Player Settings is used for the 1st scene in the build.
  10. Option: File > Build Profiles > Development Build > Check (to See the Log in the Console).
  11. File > Build Profiles > Player Settings > iOS > Other Settings > Configuration > Camera Usage Description > Fill it (any notice for your app).
  12. Test in the Unity Editor or Build.

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

Placing Visible Game Objects

If you need to place visible Non-UI Game Objects over the Device Camera Feed, then just Activate the Game Object called Game World, and place Game Objects inside it.

Game World contains a separate Camera for this task: Main Camera.

After activating, you will have 2 Game Cameras in the Scene:

  • Background Camera (UI Layer) for Device Camera Feed and UI.
  • Main Camera (other Layers) for visible Non-UI Game Objects.

Game Objects will not move based on Device Movement.
Use AR Camera Lite (docs) or AR + VR: MR Camera (docs) instead.


Feed FPS and App FPS

The Unity Package has a Prefab called CameraFeedOnBackground that is already customized for the best experience in the Demo Scene.

You can customize the Prefab Instance on the Scene with Target FPS of Camera Feed (1) and App (2) — these 2 types of Frames Per Second (Frame Rate) are set independently of each other in the inspector of the CameraFeedOnBackgroundControl.cs script:

  1. Requested FPS: Camera Feed will use the closest supported FPS. Zero (0) FPS will lead to Value by Default.
  2. The App will strive to use Target FPS that is set in the Events section.
Camera Feed on Background — Unity Editor of Unity Asset — Mobile Camera Stream — Device Camera

Testing

You can test Camera Feed quickly in the Unity Editor without a Smartphone through physical Web Camera.

Tested with Platforms

Mobile Platforms:

  • iOS on iPhone 15;
  • Android on Samsung Galaxy A71.

If you need WebGL support, please use a 3rd party asset called Device Camera WebGL.

Support

First, read the latest docs online.
If it didn’t help, get the support:

Changelog

Check the current version of Camera Feed on the Asset Store.
The latest versions will be added as soon as possible.

3.0 (Unity 6.3):

Improvements:

Fixes:

  • All Bugs related to the Unity Engine itself like WebCamTexture lagging and others were fixed without notices (I didn’t observe them during the last tests).

2.0:

Features:

  • Button: Switch Camera (Back/Front).
    • Unity Event OnCameraSwitched() is exposed in Inspector.

Improvements:

1.3:

Features:

  • Front Camera Support.

1.2:

Improvements:

Fixes:

  • Zoom Effect of Camera Feed in Vertical/Portrait Mode.

1.1:

Features:

  • Horizontal/Landscape Mode support.
Unity Assets

Support for Unity Assets

I am Andrey Sirota, Founder of Makaka Games and full-time Publisher on the Unity Asset Store. First, read the latest docs online. If it didn’t help, get the support.
Back to top button