How to play
- In VR: grab the sides of the cabinet and pull the triggers for the flippers. Grab the plunger, pull it back and let go to launch the ball.
- On PC: stand on the glowing square on the floor in front of the machine. Left Shift and Right Shift work the flippers. Hold Enter and let go to launch: the longer you hold it, the harder the launch.
- The keys only work while you stand on the square, so they don't get in the way anywhere else in the world.
- You get 3 balls. A ball that gets past the flippers is lost; after the last one, launch again to start a new game.
- Everyone plays their own game: the ball isn't synced, so two people can't play the same game.
1. Pick how you build your world
Pinball is an Altspace snippet: a ready-made piece you drop into your world. Its name (the "slug") is always:
Type it exactly like that (all lowercase). Pick the way you build your world and follow that section below.
I build my world in Unity
You use the Altspace Creator SDK in Unity. You get the settings in the Inspector, and you can move the machine with the gizmo.
Go to the Unity stepsI edit my world on the website
You edit your world on altvr.app in your browser. You copy the snippet from the Snippets section (or below) and paste it into your world's HTML.
Go to the website steps2a. Add it in Unity
You need a Unity project with the Altspace Creator SDK already set up, and your world's scene open.
- Make an empty object. In the top menu choose . Rename it to
Pinballso you can find it later (the object's name doesn't matter, only the slug does). - Add the Snippet component. Click , type
Snippetin the search box, and pick . - Type the slug and press Enter. In the Snippet's Slug box type and press Enter (the box only takes it after Enter or clicking somewhere else).
It downloads the snippet and adds it to your world's
Assets/WebRoot/index.htmlfor you. After a moment the Inspector shows the title Pinball and its settings. If nothing happens, click Refresh from server. - Put the machine where you want it. Set
positionto the spot on the floor (or drag the gizmo), androtationto turn it, for example0 180 0. Players stand on the machine's +Z side, so leave about 1.5 m of floor there. - Save the scene. Press Ctrl + S (Windows / Linux) or Cmd + S (Mac).
Do this every time you add or remove a snippet. Closing Unity without saving is the main way extra copies of the snippet end up in
index.html. - Upload your world the same way you always do, then join it in Altspace.
2b. Add it on the website
- Open your world for editing on altvr.app and go to the Snippets section.
- Find Pinball. Set the list to show All snippets, then search for
Pinball(or scroll to it) and open it. - Copy it. Click Copy & open index.html. This copies the snippet's code and opens your world's HTML (or copy the full snippet code below).
- Paste it in the right place. If your HTML has these two lines, paste between them:
If it doesn't have them, paste it just before<!-- snippet section --> paste here <!-- end snippet section --></body>. - Change the settings by editing the values in quotes in the pasted code, for example
position="4 0 -2". - Save, then join your world.
Keep the code tidy. Every value needs quotes around it (position="4 0 -2", not position=4 0 -2), and a & in any link must be written as &. Unity reads this part strictly, and one mistake can break the whole snippet section.
The full snippet code
This is everything the snippet adds, with every setting at its default. Click the code to copy it.
<!-- snippet section -->
<bs-snippet name="pinball" title="Pinball"
description="A playable pinball machine with real ball physics, sounds and lights. VR: grab the cabinet sides and pull the triggers. PC: stand on the square in front, Shift keys flip, hold and release Enter to launch."
script="https://pinball.firer.at/snippet.js"
position="0 0 0"
rotation="0 0 0"
bundle-base="">
<bs-gizmo type="position" attribute="position"/>
</bs-snippet>
<!-- end snippet section -->
Settings
All optional. An empty or missing setting uses the default.
| Setting | Default | What it does |
|---|---|---|
position | 0 0 0 | Where the machine stands: x y z in world units (metres), the floor under the middle of the cabinet. |
rotation | 0 0 0 | How it's turned: x y z in degrees, usually just the middle one (0 90 0). Players stand on its +Z side. |
bundle-base | (empty) | A different folder to load the machine from. Leave it empty. |
Good to know
- You can add more than one machine: add the snippet again with a different
position. On PC each machine only listens while you stand on its own square. - The square in front of the machine is 0.9 m across, so leave about 1.5 m of clear floor on the machine's +Z side.