Take a 10-minute challenge.
Now, the aim of this video is to prove that from nothing we can create our first augmented reality experience in under 10 minutes. Now, all I've done so far is I've opened up a new project, and I'm going to call mine the 10 Minute Challenge, because that's what this is. We are going to use a 3D template and we're going to use our image target of the Lamborghini to trigger off an augmented reality experience. Now, if you haven't got it already, what I want you to do will work just the same if you hold the mobile device up in front of the camera. Now what we're going to do is we're going to create an augmented reality camera on the project. We're then going to import our database, configure the camera to look for the correct database, and then we're going to download a model to be used as the augmented reality experience based on when the camera detects from the identifiable marker points on this image, it will then look for the identifiable marker points and should it find them, it will then use the image target as a location to superimpose our 3D model on top. So, can we do it? Here is my timer, I'm going to add 10 minutes to the timer, and hit go. Okay guys, the clock is ticking. So first thing that we need to do, we need to set Unity up to use augmented reality. At the moment, inside the game view, it uses the default scene which is nothing at the minute, that's all the camera can see. Our little 3D world of nothingness and this little sky box around. Now we don't want to use this camera, so I'm just going to delete the camera. What I want to use is Vuforia augmented reality camera. Now, we need to go into the build settings first and activate that. So, file, build settings, and I'm going to use Android for today, and switch the platform. And then what we're going to do, is go into the player settings and enable something called the XR settings, which will tell Unity that when we press play, whatever the camera is on the scene, I want it to be an augmented reality camera. Therefore, what it will do, if I just move myself for a second, is attach a couple of extra scripts to the camera and activate the webcam. The webcam will then be used as a background on our scene. Now that's effectively kind of the image and the method that this software is put together. So, make sure that you're on XR settings, which is the last tab, and just click Vuforia augmented reality, and that's everything set up ready now. So, let's go to the game object button up at the top, and we need to go down to Vuforia, which is now integrated with Unity, which is so much easier compared to a couple of years ago, and I want you to click to add an AR camera. It wants to add a couple of assets so just allow it to do that. Now, what this will do is it will create a camera with the required scripts already attached, so when I press play it will activate my webcam and the game view will turn into a camera because it's using a texture on top of the camera, or on top of the scene, and placing the image sent from the devices camera on top of that texture, and that's kind of how it works. Now what we need to do once this is finished updating, there we go, is now come down to the bottom, right click and import package, and the package that we want is the custom package of the devkitAR database, which contains our Lamborghini graphic. Here it is, look, scaled down. So when I click import, it will add the database information from the Vuforia website into our scene. Now that's done, that means I can click on the camera and make sure everything's configured how I want it to. So I'll just move myself to the side, and grab my license key for a second, there we go, okay. Now, if I open the Vuforia configuration, there we go, I can paste in my license key up at the top. Now, the other thing that I want to do is to use something called extended tracking. called extended tracking, and it used to be inside the image target under the advanced tab and a little checkbox here, so if you're using 2017 or early versions of Unity 2018, that's where it was. But they've now moved this to the AR camera, and it's a little link here, look for the device tracker settings, and if that gets removed in the future, you can also find that by going to the camera, into the Vuforia configuration, and here's the device tracker. So I want you to tick this box, put the tracking mode to positional, and optimize for image targets. Now what that does is it will make it so that when I've created the instance of the object and the scene, the object will be created there. Now, if I turn away with the camera, for example, on my mobile, it will use a gyroscope in the device to maintain the world position of that object so if I turn back, the car will still be exactly where we left it, which is fantastic if you want to create larger scale augmented reality. In this particular case, I just want to do it so I can demonstrate if you move around a little bit, that the object will remain in the scene. Okay, so let's get an object then. We're going to go to the asset store, and I want to download one of these models here of a Lamborghini, and there's a great little free Lamborghini in the asset store. Okay, what I want you to search for is sport car 3D, and this model here, the orange Lamborghini, is the one that we actually want. Now, if you haven't got this already, then scroll down and it will probably say download, mine actually says import because I've already downloaded the model. Now, here we go, let's import the model. If you don't know what this is by the way, this is the Unity asset store where you can download anything from free models through to audio tracks or plugins. Okay, and then what this will do is, down at the bottom, once this is finished importing, it will create a folder for the assets down in project down at the bottom. Here it is, look, the sports car. So let's switch back to the scene for a second, and if I click on my image target, which is where I want the car to appear, if I open up the folder and jump through to the pre-fabs, I can find the model, the temperate pre-fab that they created, and drop that onto the image target, onto the target, so it becomes a nested child. Now I'm just going to reset the position down to about 0.2, and set the scale to be 0.05 because I happen to know that this is pretty large, there we go. I'm also going to rotate it, minus 90. Okay, cool, so now we have the 3D model placed on top of our target, I'll just move it back slightly, and based on the size of the image that I'm using which is A4, the car should appear in scale relative to the size of my paper. Now, I'll just expand this and go into the body for a second, because I might as well change the color, which is here in the inspector, and I'm just going to make this kind of an orangey color, there we go. Okay cool, we've still got some time to kill, we've got about a minute left, so let's have a quick recap for a second. We've got an AR camera that is configured to use the background image with my webcam over the top. We then have an image target that is configured to use our database of information and store the graphic of the Lamborghini. The image target has a child object, which is the car, on top, and if everything runs according to plan, when I hold up the image, the AR camera should detect the graphic based on our database, and superimpose our 3D model on top. With extended tracking on, so even if I move the target out of the camera, the car should remain in place. So moment of truth guys, let's give it a quick run, here we go. Just to make sure I've not done anything wrong (laughs), we've still got 30 seconds. Okay then, here we go, here's the image target. And fantastic guys, there we go, look, our first augmented reality experience. So it's placed the model relative to where I positioned it on the scene, in relation to its size and everything else, and we still have a few seconds to go. (bell ding) Fantastic, guys. Well, well done, and congratulations on your first augmented reality experience. Okay, fantastic guys, so well done, fantastic. I hope you enjoyed putting together your first augmented reality scene, and okay, a little bit over 10 minutes if you include the opening of the software and everything else, but fundamentally, once you're up and running inside a project, you can create an AR camera, download the correct database and the information, and configure Vuforia to run, and create an augmented reality experience just like we just have. Okay, fantastic, I'll see you in the next videos, guys.
- Discovering the right platform
- Creating an AI bot
- Setting up your project in Unity
- Adding and animating vehicles
- Hooking up buttons
- Creating a particle system effect
- Connecting Unity to cloud-based AI
- Exporting field tests for Android and iOS
- Building the car animations
- Creating an animations handle switch
- Developing the ground planes scene