Setup
This guide walks you through installing the UG Labs Unity SDK and configuring your Unity project.
Installation
Add Package via Git URL
- Open Unity Package Manager (
Window > Package Manager) - Click the
+button in the top-left corner - Select "Add package from git URL..."
- Enter the following URL:
https://github.com/uglabs/ug-unity-sdk.git
- Click Add
Unity will download and install the package automatically.
Verify Installation
After installation, you should see UG SDK in your Package Manager under "Packages - Custom".
Project Configuration
Create Settings File
The SDK requires a settings file to store your configuration:
- In the Unity Editor menu, go to Assets > Create > UG SDK > Settings
- This creates a
UGSDKSettingsasset in your project - The settings file will be created at:
Assets/Resources/UGSDKSettings.asset
Configure Settings
Select the UGSDKSettings asset and configure:
- API Endpoint:
wss://pug.stg.uglabs.app/interact(staging) - Access Token: Your UG Labs access token (can be set at runtime)
For security, it's recommended to set the access token at runtime rather than storing it in the settings file:
UGSDK.Instance.Initialize(accessToken);
Platform-Specific Setup
iOS Configuration
For iOS builds, you need to configure microphone permissions:
- Open
Assets/Plugins/iOS/Info.plist(create if it doesn't exist) - Add microphone usage description:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to your microphone for voice conversations with AI characters.</string>
</dict>
</plist>
- In Player Settings (
Edit > Project Settings > Player):- Select the iOS tab
- Under Other Settings, ensure Microphone Usage Description is set
Android Configuration
For Android builds, add microphone permission to your manifest:
- The SDK automatically includes the required permission in its
AndroidManifest.xml - Ensure your Target API Level is set to 24 or higher in Player Settings
The SDK will automatically request microphone permissions at runtime when you start recording. No additional code needed.
Build Settings
Minimum Requirements
iOS:
- Deployment Target: iOS 13.0 or later
- Architecture: ARM64
Android:
- Minimum API Level: 24 (Android 7.0)
- Target API Level: 33+ recommended
- Architecture: ARM64
Required Capabilities
The SDK requires network access. Ensure your build settings include:
- iOS: No additional configuration needed (network access is automatic)
- Android:
INTERNETpermission (automatically included)
Troubleshooting
Package Not Found
If you encounter "Package not found" error:
- Verify the git URL is correct
- Ensure you have git installed on your system
- Check your Unity version (6.0+ required)
Microphone Not Working
If microphone recording fails:
- iOS: Verify
NSMicrophoneUsageDescriptionis set - Android: Check that microphone permission is granted in device settings
- Test on a physical device (microphone may not work in editor/simulator)
Build Errors
If you encounter build errors:
- Clean the build folder (
Build > Clean All) - Reimport the SDK package
- Check Unity console for specific error messages
Next Steps
- Quick Start - Run your first conversation
- Usage Example - Complete implementation guide