Hello World
The simplest HoloScript program - a glowing greeting orb.
.hs Version (Classic)
hs
// hello-world.hs
// A simple greeting orb that displays a welcome message
orb greeting {
message: "Hello, HoloScript World!"
color: "#00ffff"
glow: true
position: { x: 0, y: 1.5, z: -2 }
}
function displayGreeting() {
show greeting
pulse greeting with duration 1000
}
// Execute on load
execute displayGreeting.holo Version (Composition)
holo
// hello-world.holo
composition "Hello World" {
environment {
skybox: "gradient"
ambient_light: 0.5
}
object "Greeting" {
@glowing
position: [0, 1.5, -2]
color: "#00ffff"
glow_intensity: 1.5
text: "Hello, HoloScript World!"
}
logic {
on_scene_load {
pulse Greeting over 1s
}
}
}What This Does
- Creates an orb at eye level, 2 meters in front of the user
- Makes it glow with a cyan color
- Displays text saying "Hello, HoloScript World!"
- Pulses the orb when the scene loads
Try It
- Save as
hello-world.holo - Open in VS Code with HoloScript extension
- Run HoloScript: Preview Scene
Compile Targets
bash
# Three.js (Web)
holoscript compile hello-world.holo --target threejs
# Unity
holoscript compile hello-world.holo --target unity
# Output
# ├── dist/threejs/hello-world.js
# └── dist/unity/HelloWorld.csNext Steps
- Add @grabbable to make it interactive
- Add @physics for realistic movement
- Try Interactive Cube for more interactivity