AirDrawXR is a Unity-based augmented reality (AR) application for gesture-based 3D drawing using hand tracking. This project showcases two demo scenes built using Unity’s AR Foundation and MediaPipe Hands (via the Homuler Unity plugin).
- Unity Editor: 6000.0.41f1 (Apple Silicon-compatible, LTS)
- Xcode: 14.3 or later (with iOS 16+ SDK)
- AR-capable iOS device (for Demo1)
- Apple Developer account and device provisioning
- Packages:
- AR Foundation 5.1.3 or later
- ARKit XR Plugin
- Homuler’s MediaPipe Unity Plugin
– https://github.com/homuler/MediaPipeUnityPlugin
PATH: Assets/Scenes/
3D drawing in real-world space using AR Foundation and hand gestures. Requires an ARKit-capable iOS device.
Detects hand landmarks via the Homuler MediaPipe Unity plugin. Run in the Unity Editor without deploying to a device.
Here is a Google Drive link to a built project. Just download the folder as a zip, extract, run xcodeproj file and then sign the build as explained below and run the project.
Follow these steps to build and run Demo1 on your iOS device:
-
Install & Configure Unity
- Open Unity Hub, install version 6000.0.41f1 (Apple Silicon).
- Create or open the AirDrawXR project.
- In Package Manager, ensure AR Foundation 5.1.3+, ARKit XR Plugin, and MediaPipeUnityPlugin are installed.
-
Switch Build Target
- Go to File > Build Settings.
- Select iOS and click Switch Platform.
- In Player Settings > Other Settings, set:
- Scripting Backend: IL2CPP
- Architecture: ARM64
- Bundle Identifier: e.g.
com.yourcompany.airdrawxr - Camera Usage Description: “This app requires camera access for AR drawing.”
-
Enable XR Plugins
- In Project Settings > XR Plug-in Management > iOS:
- Check ARKit.
- Under Subsystems, enable ARKit Face Tracking and ARKit Plane Detection if needed.
- In Project Settings > XR Plug-in Management > iOS:
-
Configure Signing & Capabilities
- In Project Settings > Player > iOS:
- Under Identification, select your Team.
- Ensure Automatic Signing is enabled.
- In Project Settings > Player > iOS:
-
Prepare Scenes & Assets
- In Build Settings > Scenes In Build, add:
Assets/Scenes/Demo1.unity
- Confirm the ARCamera in the scene uses the ARCamera Background component.
- In Build Settings > Scenes In Build, add:
-
Build Xcode Project
- In Build Settings, set Development Build (optional) and click Build.
- Choose an output folder and wait for Unity to generate the Xcode project.
-
Open & Configure in Xcode
- Launch the generated
.xcworkspacein Xcode. - Select your connected device as the build target.
- In Signing & Capabilities, verify your Team and provisioning profiles.
- Under Build Settings, ensure iOS Deployment Target ≥ 14.0.
- Launch the generated
-
Run on Device
- Click Run (▶) in Xcode to install and launch the app on your device.
- Grant camera and motion permissions when prompted.
-
Troubleshooting
- If provisioning errors appear, verify your Apple Developer portal certificates and profiles.
- Ensure device is in Developer Mode (Settings > Privacy & Security).
- Clean the build folder in Xcode (Product > Clean Build Folder) before rebuilding.
-
Unity → iOS AR Build Tutorial
https://www.youtube.com/watch?v=8xvLjh3Xn18 -
Homuler MediaPipe Unity Plugin
https://github.com/homuler/MediaPipeUnityPlugin
- Development done on Apple Silicon Mac using Unity 6000.0.41f1.
- Tested with iOS 16+ on iPhone 13 and newer.
- For Demo2, open
Demo2.unityand run in Play Mode inside the Unity Editor.
Feel free to fork or contribute—pull requests are welcome!