A simple AR Pet using Apple AR Kit plugin on Unity
If you want to use the AR Kit plugin on your project you must follow this step-by-step guide
- iOS Device with a A8 chip or best
- Macinstosh device with Xcode 9 installed
- Unity
- Open Unity on your device and download the AR Kit Plugin
- Once donwloaded, import the files off the plugin
- You are ready to go!
I have the plugin installed but, now what?
When you have all the files imported, you must think, how do I do something with this? Well, we are on our way
First of all navigate through the folders and find the one called /Examples/UnityARKitScene
double click on the asset UnityARKitScene.
You must see something like this:
The image on top ilustrates the current scene. Currently this game will just place one cube wherever you touch the screen. But wouldn't it be cooler that you could change that "ugly" cube and place instead one 3D object? In this example you will use the Cartoon Cat asset that can be found on the Asset Store.
- Replace the
HitCube
gameobject for one of the 3D models in the Cartoon Cat asset - Delete
RandomCube
gameobject - In the assets folder search for
shadowPlanePrefab
and add it to the Scene - On
CameraParent
reset the axis tox:0, y:0, z:0
. Do the same withHitCubeParent
gameobject, andshadowPlanePrefab
After doing the instructions on top, the scene must be something like this:
Then you just have to build the game with: ⇧ + ⌘ + B
Keep reading to learn how to build the project in Xcode
Open Xcode and search the path of the builded unity game. In my case is /Unity/AR Test/Builds
Once opened, you have to modify the Unity-iPhone
build file. Change the name of the app on Display Name
, and the bundle identifier.
You have to sign the app with your Developer account. Change the Deployment Target to iOS 11.0
.
Device orientation has to be like this:
- Portrait
- Upside Down
- Landscape Left
- Landscape Right
And you have finish! Make sure your iOS Device is plugged in, and click play button to build the project.
- Unity AR Kit Plugin reference
- YouTube tutorial
- Previous experience building Xcode apps