The VR Multiplayer Golf Game is an immersive virtual reality experience that combines physical hardware with a mobile VR environment, enabling players to swing a real-world golf stick and interact with a wearable controller for enhanced realism. Designed for Android smartphones and compatible with standard VR headsets (Google Cardboard), this project allows two players to connect, communicate, and compete on stunning virtual golf courses—no matter where they are in the world.
We used Unity Version Control for managing the project's source code and collaboration between team members.
If Someone is to recreate the project, they need to have Unity Version Controlling Software Installed, and use the following link to get the required files plastic://e20420.unity/repos/CO3060VRGolfGame%2fVRGolfMultiplayer (Use this as a hyperlink in your browser which will launch Unity Plastic SCM)
- Features
- System Architecture
- Hardware Stack
- Game_Design
- Device Connectivity
- Technologies Used
- Requirement_for_installation
- How to Play
- Link
- Testing
- Team
- Real-time Multiplayer: Play against friends in a synchronized VR environment.
- Physical Interaction: Use a custom-built golf stick and handwear controller for realistic swing and motion tracking.
- Voice Chat: Communicate live with your opponent using secure, low-latency voice chat.
- Authentication: Sign in easily using email and password.
- Session Statistics: Track shots, scores, and game progress in real time.
- Haptic Feedback: Feel every swing and impact through vibration motors in the hardware.
- Cross-Platform Play: Works on any Android phone with VR headset support.
The system consists of:
- Client Devices: Android smartphones running the Unity VR app, mounted in VR headsets.
- Physical Controllers: ESP32-powered golf stick and handwear controller, each with sensors and buttons.
- Networking: Photon Cloud for multiplayer synchronization and voice chat.
- Authentication: Sign-In for secure login.
- Input: User swings golf stick or presses a button; ESP32 reads sensor data.
- Transmission: ESP32 sends data via Wi-Fi UDP to the smartphone.
- Processing: Unity app interprets the data, updates the VR environment, and synchronizes actions with the Photon Cloud.
- Feedback: Haptic motors provide physical feedback, and voice chat enables real-time communication.
- Unity Game Development
- Tool Used: Unity Hub with Unity Editor v2022.3.62f1, C# languaage, Modular, scene-based,Photon PUN, Photon Voice, assets.
- Firebase Authentication
- User registration (email & password), Login functionality.
- UDP Communication
- ESP32 reads motion data from the MPU6050 sensor and it connects to a Wi-Fi network and sends the data via UDP packets.
- ESP32 controllers in both the golf stick and handwear module collect sensor/button data.
- Data is transmitted via Wi-Fi UDP to the smartphone running the Unity VR app.
- The app processes this data for real-time gameplay and synchronizes player actions using Photon PUN and Photon Voice.
- WiFi is also used for some sensor data transmission.
| Layer | Technology/Tool |
|---|---|
| Game Engine | Unity 2022.3.62f1 |
| Networking | Photon PUN & Photon Voice |
| Authentication | Google Sign-In (Firebase Auth/Unity Social APIs) |
| VR Implementation | Google Cardboard Plugin |
| Controller | ESP32, WiFi |
| Programming Languages | C# (Unity), C++ (ESP32), Java (Unity Plugins) |
| Platform | Android VR Devices |
| Input APIs | Unity Input System |
| Build System | Gradle / Unity Build Pipeline |
| Communication | BLE, Wi-Fi UDP, Photon Cloud |
| Voice Chat | Photon Voice (AES-256 encryption) |
- General Requirements - VR Golf Application ,Internet Connection, mobile VR Headset or cardboard vr box.
- Mobile Phone Requirements - Storage (At least 50 MB free for the app) , Compatible for vr rotation/ mobile's gyrosensor
- Gaming Kit - golf club stick,Hand Band.
- Install the game on your Android phone.
- Login using your Email and Password.
- Connect the ESP32-based golf stick and handwear controller via Wi-Fi.
- Start a Session: The admin user creates a session and shares the code with the other player.
- Join: The second player enters the code to join the game.
- Mount your phone in a VR headset (Google Cardboard or similar).
- Play: Swing the golf stick and use the handwear controller to interact with the VR world. Take turns, communicate via voice chat, and compete to win!
- Unit Testing : Test individual modules(sensor readings, UDP socket handlers, Ui Components,
- Integration Testing: Test communication between ESP32 ↔ Unity Game (use demo scenes) .
- System Testing: Test the game as a whole in VR with real-time interaction.
- Usability Testing: Evaluate user experience with real players.
- Kavindu Methpura
- Binuri Senavirathna
- Rashmika Sewmini
- Janith Wanasinghe
For questions or feedback, contact:
The VR Multiplayer Golf Game provides a unique, realistic, and social VR sports experience by blending custom hardware with advanced mobile VR technology. With real-time multiplayer, voice chat, and physical feedback, it brings the excitement of golf to the virtual world—anywhere, anytime.
For more details, see the Comprehensive Documentation PDF.









