- Home /
How to access device (iPhone/Android) native camera?
Hi,
I am building an app which needs access to the device's native camera?
Can anyone give me pointers on how to do that please?
Thanks.
http://lmgtfy.com/?q=unity+ios+camera
http://lmgtfy.com/?q=unity+android+camera
I never thought I'd have to use that on you :P
Hi. I got here through googling "Unity android camera" and I find your coment most useful. Thanks!
@meat5000 what abbout fact, that "camera" is component in Unity engine, and most results describe camera as rendering element?
Hi @ZenithCode
If you want to create something that resembles a camera app inside your game you might consider using some extensions to the WebCamTexture ( https://www.assetstore.unity3d.com/en/#!/content/56673 ) - CameraCapture$$anonymous$$it extends the webCamTexture so you can enable stuff like Focus, Flash, Torch and will make the quality of the image taken higher.
Cheers
Answer by ZenithCode · Oct 19, 2013 at 12:12 PM
Thanks @meat5000
I've found the solution but never updated the question.
The camera can be access through the WebCamTexture API. (Not intuitive/right name but it works)
http://docs.unity3d.com/Documentation/ScriptReference/WebCamTexture.html
Answer by shacharoz · Feb 29, 2020 at 08:59 PM
i am trying to run my camera on my phone (android api 24, Cubot Magic).
running this code :
WebCamDevice[] devices = WebCamTexture.devices;
my devices list is empty and has no devices.
i did remember to ask for permission to the camera and the app actually asks me that.
any idea what is happening?