A VR basketball game built with Unity.
- Unity Version: 6000.0.44f1
- Render Pipeline: Universal Render Pipeline (URP)
- Target Platform: Android (Meta Quest)
- Clone the repository
- Open the project in Unity 6000.0.44f1
- Ensure XR Plugin Management is configured for your target headset
- VR basketball shooting mechanics
- Score tracking system
- XR Interaction Toolkit integration
Assets/
├── Scenes/
│ └── SampleScene.unity # Main game scene
├── BasketScore.cs # Score tracking interface
└── ...
The scoring interface is located in Assets/BasketScore.cs. Access the current score via:
BasketScore.scoreAll basketball objects must have the "Basketball" tag to interact properly with the hoop detection system. When adding a new ball:
- Create or import your ball prefab
- Select the GameObject
- In the Inspector, set Tag →
Basketball
| Tag | Purpose |
|---|---|
Basketball |
Ball objects for hoop interaction |
Anchor |
XR anchor points |
Rack |
Ball rack/storage |
HoopCenter |
Basket detection trigger |
Ground |
Floor collision |
- Go to File → Build Settings
- Select Android platform
- Ensure XR settings are configured in Project Settings → XR Plug-in Management
- Click Build and Run
- XR Interaction Toolkit 3.1.1
- XR Hands 1.5.1
- OpenXR 1.14.1
- Input System 1.13.1
- Universal RP 17.0.4