Getting Started
Up and Running in No Time
Importing NatDevice
To begin, import the API with the Unity Package Manager by adding the following lines to your Packages/manifest.json
file:
Specifying your Access Key
In order to use NatDevice, you need a NatML access key, along with an active Cloud Plan subscription. Retrieve your access key from NatML Hub:
Once you have your access key, add it in Project Settings > NatML
:
Using NatDevice requires an active NatML MediaKit subscription. You can try it out for free, but functionality is limited. See the FAQ for more info.
Running the Camera Preview
Now that we're all setup, let's write a minimal example to display the camera preview.
Now, let's setup our UI. We'll use a RawImage
to display the camera preview to the screen. We will also add an AspectRatioFitter
so that the preview doesn't look stretched when it is displayed.
Now, let's setup HelloCam
in our scene. We'll create an empty game object and add our script. Then, assign the RawImage
and AspectRatioFitter
we created above.
Now press Play and you should see a fine human smiling at you!
Last updated