Journal 129 — Unity App Development, Add Camera Access to Take Photo

Objective: To add camera access to phone and take a photo for records

In the previous article, I added geolocation services to record the location of the user’s phone. In this article, I will add camera access to use the mobile device camera and take a photo.

We can start with a download from Unity to access the camera on IOS and Android.

After you add to your assets, you can open the Package Manager and import to the project.

From there, we want to look at the Readme file in the asset folder. Since I’m using Unity 2021, there is no need to update the AndroidManifest.xml file, unlike previous versions of Unity.

Now over at the Github repository, the README.md includes an example script on how to implement. In our case, we don’t need to create a temporary quad. We need to create the Texture2D and assign our variable to this texture.

Here is how I implemented this.

In the Scene view, I added a Button component to the photo screen.

And now, we can see this in action.

Here is the final layout of the app.

Thank you for your time!

In the next article, I will continue with the AWS access to save the user data entered.

--

--

--

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to keep multiple versions of Flutter

How to run UIautomatorviewer on mac

How I drew custom shapes in bottom bar

Novice Note: Try Integrate HMS Map Kit in Ubuntu 21.10

Don’t get confused on delay & Thread.sleep() in Kotlin Coroutines

Accessibility testing for Android apps — how to start

How to make an activity full screen in android studio?

MVC,MVP & MVVM overview

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chris Nielsen

Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

More from Medium

Journal 146 — Unity Project Development, 2.5D Shooter

Unity Animation Event Explained

Gamedev Log: “The Escape” #1 (Unity/C#)

A Series On Creating Immersive Audio in Unity with Custom Wwise Scripts