Universal HoloScript example demonstrating corporate training use cases.
This example showcases HoloScript's capabilities for creating professional VR training simulations. It demonstrates a complete workplace safety training program that can be deployed across multiple platforms without code changes.
✓ Interactive Training Modules
- Hazard identification challenges
- Proper lifting technique demonstrations
- Emergency response procedures
✓ Guided Learning Experience
- AI instructor avatar with voice narration
- Visual path guidance with waypoint markers
- Real-time progress tracking with HUD
✓ Accessibility
- Multi-language support (6 languages)
- Subtitles and audio descriptions
- Colorblind modes
- Desktop/mobile fallback for non-VR users
✓ Completion Tracking
- Points-based scoring system
- Downloadable PDF certificates
- Analytics and reporting
After completing this example, you'll learn how to:
- Structure training simulations with zones and modules
- Create interactive objects with collision, physics, and behaviors
- Implement guided navigation with waypoints and visual paths
- Build UI overlays for progress tracking and feedback
- Add audio/visual effects for immersive experiences
- Export to multiple platforms from a single HoloScript file
# Unity (recommended for Quest/PCVR)
holoscript compile workplace-safety.holo --target unity --output ./output/unity/
# Unreal Engine (high-fidelity visuals)
holoscript compile workplace-safety.holo --target unreal --output ./output/unreal/
# WebXR (browser-based, no headset required)
holoscript compile workplace-safety.holo --target webxr --output ./output/webxr/
# Godot (open-source alternative)
holoscript compile workplace-safety.holo --target godot --output ./output/godot/- Import compiled scripts into Unity project
- Ensure XR Interaction Toolkit is installed
- Build for your target VR platform (Quest, PCVR, etc.)
- Deploy to headset
- Import compiled C++ files into Unreal project
- Enable VR plugins (OpenXR, SteamVR)
- Package for VR platform
- Deploy
- Host compiled HTML/JS files on web server
- Open in WebXR-compatible browser (Chrome, Firefox)
- Click "Enter VR" button
- Use headset or desktop/mobile fallback mode
- Import compiled GDScript files into Godot project
- Configure OpenXR settings
- Export for target platform
- Deploy
environment#warehouse @indoor @realistic {
skybox: "warehouse_hdri"
ambient_light: { intensity: 0.4, color: #e8e8e8 }
fog: { density: 0.001, color: #d0d0d0, start: 20, end: 100 }
}
Creates a realistic warehouse environment with proper lighting and atmosphere.
Each station is a self-contained zone with:
- Interactive objects (hazards, equipment)
- Feedback mechanisms (tooltips, popups, scoring)
- Completion tracking
Station 1: Hazard Identification
- Identify wet floor hazard
- Clear blocked emergency exit
- Learn hazard reporting procedures
Station 2: Proper Lifting Technique
- Follow correct posture (knees bent, back straight)
- Lift and place objects safely
- Real-time posture feedback
Station 3: Emergency Response
- Locate fire extinguisher
- Activate fire alarm
- Practice evacuation procedures
path#training_route @visual_guide {
waypoints: [
{ x: 0, z: 0, label: "Start" },
{ x: 5, z: 5, label: "Hazard Identification" },
// ...
]
visualize_path: true
show_arrows: true
}
Creates a visual path guiding trainees through the experience.
ui#progress_hud @always_visible @top_left {
progress_bar#hazards {
label: "Hazard Identification"
track_completion: ["hazard_1", "hazard_2"]
}
// ...
}
Real-time HUD showing completion status and score.
on_interact {
if (all_modules_complete && player.score >= 50) {
export_certificate: {
format: "PDF"
filename: "safety_training_{player.name}_{date}.pdf"
}
}
}
Generates downloadable certificates upon successful completion.
- Employee onboarding
- Safety certification
- Compliance training
- Annual refresher courses
- Vocational training programs
- Safety engineering courses
- OSHA certification prep
- Warehouse operations training
- Manufacturing safety protocols
- Construction site safety
Edit the training stations (lines 111-304) to customize:
- Hazard types and scenarios
- Equipment and procedures
- Scoring criteria
- Feedback messages
zone#new_training_module @training_module {
position: { x: X, z: Z }
// Add interactive objects, instructions, scoring
}
Update settings (lines 586-607):
settings {
supported_languages: ["en", "es", "zh", "fr", "de", "ja"]
default_language: "en"
}
Add translated audio files and text overlays.
Replace textures and models:
certificate_template.png- Company logo/brandingsafety_instructor.glb- Custom avatarwarehouse_hdri- Custom environment
The experience tracks:
- Module completion rates
- Time spent per module
- Scoring per attempt
- Common failure points
- User interactions
Export settings (lines 602-606):
settings {
track_completion: true
track_time_spent: true
track_attempts: true
export_report: true
}
- VR (Unity/Unreal): 90 FPS on Quest 2/Pro
- WebXR: 60 FPS on mid-range laptops
- Godot: 72 FPS on Steam Deck
- 3D Models: GLB/GLTF format
- Textures: 2K max resolution (optimize for mobile)
- Audio: MP3/OGG, compressed
- Total package: < 100 MB
Unity
- Uses XR Interaction Toolkit for controllers
- Requires Unity 2021.3 LTS or newer
- Quest build requires Android SDK
Unreal
- Compiled to C++ (header + source files)
- Requires Unreal 5.1+
- OpenXR plugin required
WebXR
- Three.js-based implementation
- Works in Chrome/Firefox/Edge
- No installation required
- Progressive Web App compatible
Godot
- GDScript output
- Godot 4.1+ with OpenXR
- Lightest compilation target
This example uses industrial realism:
- Neutral color palette (grays, yellows, safety orange)
- Weathered textures for authenticity
- Clear signage and labeling
- OSHA-compliant visual design
Easily adaptable to other styles:
- Stylized/cartoonish (gaming companies)
- High-fidelity photorealism (enterprise)
- Minimalist/abstract (artistic installations)
Improvements welcome! Ideas:
- Additional training modules (chemical safety, PPE usage)
- More accessibility features (sign language avatars)
- Multiplayer collaborative training scenarios
- Advanced analytics integration
- Mobile AR companion app
This example is provided under the MIT License. Use freely in commercial or educational projects.
Built with HoloScript - Write once, deploy everywhere. 🌐