A virtual reality exploration and collection game built with Unity 2022.3 LTS and XR Interaction Toolkit.
VR Crystal Collection Adventure is an immersive VR experience where players explore mystical environments, collect crystals through hand interactions, and navigate through magical portals. The game combines exploration, collection mechanics, and teleportation systems to create an engaging VR adventure.
- Collect 3 Crystals: Find and grab crystals scattered throughout the environment
- Portal Navigation: Use mystical portals to teleport between different areas
- Exploration: Navigate the VR world using realistic movement mechanics
- Victory Condition: Collect all 3 crystals to win the game
- Interactive Collection: Grab crystals using VR hand controllers
- Global Progress Tracking: Real-time counter tracks collected crystals
- Visual Feedback: Crystals become invisible when collected
- Win Condition: Game announces "Player Won" when all 3 crystals are collected
- Instant Travel: Step into portals to teleport to destination areas
- Smooth Transitions: Reliable teleportation with position and rotation matching
- Cooldown System: Prevents rapid re-teleportation for smooth gameplay
- Auto-Detection: Automatically finds player and handles CharacterController integration
- Grounded Movement: Realistic walking with gravity simulation
- No Flying: Prevents unintended vertical movement for immersive experience
- XR Input Integration: Uses XR Interaction Toolkit input actions
- Configurable Speed: Adjustable movement speed for comfort
- Unity 2022.3.62f1 LTS
- XR Interaction Toolkit 2.5.2
- C# Scripting
- Input System Package
CrystalCollector.cs- Handles crystal collection mechanics and win conditionsPortalTeleporter.cs- Manages portal-based teleportation systemPlayerMovementsFly.cs- Controls VR player movement with gravity
- Oculus/Meta Quest (Quest 1, 2, Pro, 3)
- SteamVR Compatible Headsets (Valve Index, HTC Vive, etc.)
- Windows Mixed Reality
- Pico VR Headsets
The game features a rich collection of environmental assets creating immersive VR worlds:
- @PaulosCreations - Custom VR-optimized models
- Altar_Ruins_FREE - Ancient mystical environments
- DimensionalAssetDesign - Sci-fi and fantasy elements
- Emilulz_Assets - Environmental props and decorations
- SnoozyRat Assets - Character and creature models
- ThreeDragons - Fantasy-themed 3D models
- TombOfSilla - Ancient tomb and dungeon assets
- Course Library - Educational VR interaction examples
Note: Asset files are not included in this repository due to size constraints. Download links for assets will be provided separately.
- Unity 2022.3 LTS or newer
- XR Interaction Toolkit package
- VR Headset and compatible PC
- Asset packages (download separately)
- Clone this repository
- Open the project in Unity 2022.3 LTS
- Import required asset packages
- Configure XR settings for your target VR platform
- Open
VR-Game-Scene.unityorMain.unity - Build and deploy to your VR device
-
Player Setup: Add scripts to XR Origin (Action Based)
PlayerMovementsFlycomponentCrystalCollectorcomponent- Ensure CharacterController is present
-
Crystal Setup: For each crystal object
- Set tag to "Crystal"
- Add Collider component
- Optional: Add XR Grab Interactable for hand interactions
-
Portal Setup: For each portal
- Add
PortalTeleporterscript to trigger collider - Assign destination portal Transform
- Configure exit offset to prevent overlap
- Add
- Movement: Use thumbstick/touchpad for locomotion
- Grab: Trigger button to grab crystals and interact with objects
- Teleport: Walk into portals for instant travel
- Look Around: Natural head movement for camera control
- Speed: Adjustable player movement speed (default: 12 units/sec)
- Gravity: Realistic gravity simulation (-9.81 m/s²)
- Ground Detection: Automatic ground detection and grounding
- Collection Mode: Choose between grab-only or proximity collection
- Crystal Count: Configurable win condition (default: 3 crystals)
- Destruction: Option to destroy or hide collected crystals
- Cooldown Timer: Prevent rapid re-teleportation (default: 0.25s)
- Exit Offset: Positioning offset to avoid portal overlap
- Auto-Detection: Automatic player detection and hierarchy support
- Player flying: Ensure gravity is enabled and CharacterController is properly configured
- Crystals not collecting: Verify crystal tags and collider setup
- Portals not working: Check portal trigger colliders and destination assignments
- VR tracking issues: Verify XR Interaction Toolkit setup and device compatibility
Assets/
├── Scripts/
│ ├── PortalTeleporter.cs
│ └── (Additional custom scripts)
├── Scenes/
│ ├── Main.unity
│ ├── VR-Game-Scene.unity
│ └── SampleScene.unity
├── CrystalCollector.cs
├── PlayerMovementsFly.cs
└── [Asset Folders - Not included in repo]
in repo]
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
This project is open source. Asset packages may have their own licensing terms.
- Unity Technologies for XR Interaction Toolkit
- Asset creators for environmental content
- VR development community for inspiration and support
Enjoy your VR Crystal Collection Adventure! 🎮✨