Search code examples
unity-game-engineios-simulatorarkitarcoregame-development

How to use PC webcam for AR Foundation in Unity


I am currently working on a project that has AR stuff in it, so before I start I've decided to use ARFoundation. Now when my project is done I have to test it, but unfortunately my phone does not support ARKit. So I decided to test it directly in Unity, using its play mode, but when I run it the "Game" panel gets black and I see nothing. I think it is because the webcam is not turning on. So how can I turn on my webcam in Unity in order to test my ARFoundation app?

Thanks.


Solution

  • It has nothing to do with the webcam. It is simply because ARFoundation need ARCore (android) / ARKit (ios) compatible device.

    Requirement Hardware

    1. ARKit compatible device that is also supported by ARCore.
    2. A USB cable to connect your device to your development machine.

    Source: Quickstart for ARCore Extensions for iOS

    The one with play test using Unity editor is Vuforia. Furthermore it support most modern devices.

    Vuforia Engine provides a simulator mode in the Game view that you can activate by pressing the Play button. You can use this feature to evaluate and rapidly prototype your scene(s) without having to deploy to a device.