A fully functional VR archery project built in Unity. This project serves as the foundation for a "VR Aimlabs" experience, featuring realistic bow mechanics, physics-based arrow aerodynamics, and a modular target system framework.
This project was created as part of a VR Lab Workshop to teach core VR mechanics using the Unity XR Interaction Toolkit. It implements a complete bow and arrow system where players can test their aim and reaction time.
Core Mechanics:
- Realistic Interaction: Two-handed bow manipulation (holding the grip + pulling the string).
- Physics-Based Ballistics: Arrows fly with gravity and use torque-based stabilization (aerodynamics) to prevent tumbling.
- Dynamic String: Visual string deformation using a Line Renderer that tracks hand movement.
- Auto-Reload: Automatically spawns a new arrow 1 second after firing.
- Unity Version:
2022.3.50f1 - Template: VR Core
- Hardware: Any VR Headset compatible with OpenXR/Unity XR (Meta Quest, HTC Vive, Valve Index).
The core logic is contained within Assets/Bow and Arrow/:
- Scripts:
BowController.cs: Manages arrow spawning, string visual updates, and firing power calculations based on pull distance.Arrow.cs: Handles the arrow's flight physics, applying torque to simulate fletchings (drag) so the arrow points forward while flying.
- Prefabs:
Arrow_Prefab: A pre-configured arrow with Rigidbody, Capsule Collider, and aerodynamics logic. Note: The transform scale is set to 75 to ensure visibility.
- Clone this repository.
- Open the project in Unity 2022.3.50f1.
- Open the
Basic Scene. - Ensure your VR headset is connected and configured.
- Press Play.
- Pick up the Bow: Grab the bow handle with your primary hand.
- Nock an Arrow: Move your secondary hand to the bowstring (the "Nock" sphere).
- Aim & Fire: Hold the trigger to grab the string, pull back to increase force, and release the trigger to fire.
- Reload: A new arrow will appear automatically after a short delay.
This project is intended to be extended into a full mini-game. Students and developers are encouraged to implement:
- Target Logic: Create targets that vanish upon collision and respawn in random locations.
- Game Loop: Add a "Start" button to trigger a 1-minute timer.
- Scoring UI: Implement a 2D Canvas to display hit counts and accuracy.
- Juice: Add sound effects (SFX) and particle systems for successful hits.