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.
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.
- Instant Launch after granting the camera permission.
- Quick Testing in Unity Editor with Web Camera.
- 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.
Asset doesn’t operate with Native Code and relies on WebCamTexture class.
Any possible Limitations are related to this class.
With adding rotation of the Game Camera with the Motion Sensor of a Mobile Device (Gyroscope or Accelerometer), 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 tutorial is relevant for Camera Feed on Background 1.3+.
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.
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 New Unity Project with Unity 2021.3.21 & “3D” Template.
- File > Build Settings > iOS or Android > Switch Platform.
- Next Packages must be manually installed with Git & Unity Package Manager:
- Download and import Camera Feed on Background into Unity.
- Window > TextMeshPro > Import TMP Essential Resources.
- Reopen Unity Project.
- Open Scene: Makaka Games > Camera > Camera Feed On Background > Scenes > Demo.
- File > Build Settings > Add Scenes to build:
- Permission_Camera (from Makaka Games > Permissions > Camera > Scenes),
- LoadScreen (from Makaka Games > Publisher > Everyday Tools > SceneControl > Scenes),
- Option: File > Build Settings > Development Build > Check (to See the Log in the Console).
- File > Build Settings > Player Settings > iOS > Other Settings > Camera Usage Description > Fill it (any notice for your app).
- Test in the Unity Editor or Build for Mobile.
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.
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 and App:
these 2 types of Frames Per Second (Frame Rate) are set independently of each other:
- Camera Feed will use the closest supported FPS. Zero (0) FPS will lead to Value by Default.
- The App will strive to use Target FPS.
You can test Camera Feed quickly in Unity Editor without a Smartphone through physical Web Camera.
Tested with Devices
- iOS on iPhone XS Max.
- Android on Samsung Galaxy A71.
If you need WebGL support, please use a 3rd party asset called Device Camera WebGL.
Black screen on iOS
You just need to fill Camera Usage Description in Unity Editor:
File > Build Settings > Player Settings > iOS > Other Settings > Camera Usage Description.
Check the current version of Camera Feed on Asset Store.
The latest versions will be added as soon as possible.
- Front Camera Support.
- Zoom Effect of Camera Feed in Vertical/Portrait Mode.
- Horizontal/Landscape Mode support.