From the course: ARKit and Unity: Build a Drivable Car in Augmented Reality

ARKit setup

- [Instructor] Now let's open Unity. And click on new. Let's give it a project name. I'll just give it AR Project. And create project, now I use this layout. As it's very easy to work with this layout. And if you guys follow along you can just change your layout to this one and we can do that by going to Window, layouts, and two by three layout. Now let's download the AR kit plugin which will help us in making ar kit applications. To download that go to google and type in ar kit plugin bitbucket. Go to the first link, go to downloads, download repository. After it's downloaded open the Zip file. Go to assets. And drag this unity ar plugin inside your project. Now as you can see, we've successfully imported this ar kit plugin, just open this folder, go to examples and then go to this unity ar kit scene. Just double click the scene and it will open up this scene. Now if some of you guys are new to Unity I would just like to give you a brief overview of what exactly everything is and how it works. This window here is known as the scene view. This is where we are going to see what we build. And this the hierarchy, whatever we put inside this hierarchy will be visible in the scene. So suppose if we right click 3D object, create a cube. We'll be able to see the cube right here. So while they are developing our ar application we will create some objects here and those objects will be visible in this scene. And now suppose you want to change the properties of this cube. So you have to click this cube, right here. And as you can see we have this inspector window right here. This window provides all the properties of this cube. Such as, the position of this cube, rotation, and the scale. Now we can change the position of the cube by changing the X, Y, and Z coordinates. So if I change their values to zero, zero, zero, we can see the position of this cube changed a little bit. We can also change the rotation of this cube by changing the values here. And you can also increase the scale of the cube by changing these X, Y, and Z values. And these are some of the properties which we might discuss later in the videos. For now, this is fine. Now we can also navigate our way around this cube. So we have this hand icon here. We click on this, we can just drag the scene like this. And if you click on this, and right click, you can just rotate around the scene like this. So we can use these tools to navigate around the cube. Like this. We can also rotate the cube by clicking this selecting the cube and rotating it like this. Like this, like this. And we can change the position of this cube by clicking on this and dragging this axis. And this is the asset store which is used for downloading certain things that we need during development of our application. And this folder, and this area right here, is known as the assets. Now whatever we download or whatever we import inside our project goes here. Just delete this cube, we don't need it anymore. And now, as you remember, that we are inside this ar kit scene. So as you know, we clicked on the scene so we got here and this scene provides a very good starting point for building our ar kit applications. So we are going to use this default scene so that we are able to develop our ar kit applications. Now as we are developing for Apple devices so we have to go to file, build settings, click on this iOS, and switch platforms. So that Unity knows that we are building for iOS. Now if you run the application at this point of time we will see that our application is trying to detect the horizontal plane. And as soon as it detects a horizontal plane and we tap on that horizontal plane it will keep this cube on that horizontal plane. Now this cube is inside this HitCube Parent. And this is the name of the cube. So when we click on this cube and go to the inspector window we will see that there's a script which is attached to this cube and this script is know as Unity ar hit test example. Now this is the script and the code inside this script is responsible for placing this object on the horizontal plane. So in case, we just want to delete this cube and place a sphere on the horizontal plane. We will just delete this, create a 3D sphere and attach the script to that sphere. So when we run the application we will see that sphere placed on the horizontal plane. So I just wanted to give you a brief overview of how this ar kit plugin works. So anything or any object that we want to place on the horizontal plane we have to attach this Unity ar hit test example script to that object. So that's all for this video.

Contents