This project connects Meta Quest 3 (Unity client) with an OpenAI-powered server via WebSocket, enabling real-time voice and image-based interaction through passthrough camera access.
-
Client: Unity app for Meta Quest 3
- Captures voice and camera frames
- Sends them to server for GPT-based processing
- Receives and speaks responses through TTS
-
Server: Python FastAPI + WebSocket backend
- Handles multimodal queries (text + image)
- Connects to OpenAI API (e.g., GPT-4o)
- Streams responses back to client
- Install Unity 6 (or higher)
- Import Meta All-in-One SDK (for Quest 3 integration)
- Open the Unity project
- In
WebSocketClientcomponent, set theserverUrlto your local network IP- Example:
ws://192.168.x.x:8080/ws
- Example:
- Python 3.10+
- FastAPI
- Uvicorn
- OpenAI Python SDK
- (Optional)
websocketsoraiohttpif used in your implementation
pip install fastapi uvicorn openai
Make sure your Quest 3 and server PC are on the same Wi-Fi network.
To access passthrough camera in Meta Quest, the following permissions are required.
android.permission.CAMERA
horizonos.permission.HEADSET_CAMERA- Required by Unity’s
WebCamTextureAPI for standard camera access.
- A Meta-specific system permission used to access the headset’s passthrough cameras.
- Only available on Meta Horizon OS (Quest 3 and later).
If your modified AndroidManifest.xml does not apply,
you can manually grant the required permissions using ADB commands.
Use the following commands after installing your app on Meta Quest:
adb shell pm grant {PACKAGE_NAME} horizonos.permission.HEADSET_CAMERA
adb shell pm grant {PACKAGE_NAME} android.permission.CAMERA
To check if the permissions were successfully applied:
adb shell dumpsys package {PACKAGE_NAME} | grep -i HEADSET_CAMERA
adb shell dumpsys package {PACKAGE_NAME} | grep -i CAMERA
-
Connect both Quest 3 and server PC to the same Wi-Fi
-
Set the WebSocket IP inside Unity (WebSocketClient component)
-
Start the Python server
export OPENAI_API_KEY={YOUR_API_KEY}
cd Server
uvicorn server:app --host 0.0.0.0 --port 8080 --reload
- Build & run the Unity app on Meta Quest 3 (Once launched, the Quest app will connect to the server and begin processing audio/image input through the OpenAI API.)