ScriptingExamples
Examples
Complete, copyable scripts for common world and prop features, from a spinning cube to a networked scoreboard.
Each example is a whole script with the scene setup it needs. They build on each other: start with Basics if you are new to Basis scripting, then Synced Toggle for your first networked script.
| Example | Shows |
|---|---|
| Basics | A Cilbox script, inspector fields, Update, a UI button. |
| Synced Toggle | A button that turns something on or off for everyone, including late joiners. |
| Scoreboard | A synced score kept by one owner, with other players asking the owner to add points. |
| Pickup Gun | A synced pickup that fires, with the shot shown to everyone. |
| Touch Button | Pressing a button with your finger in VR. |
| Seats | Seating, turning and ejecting players from a script. |
| Zones and Teleporters | Detecting the local player in an area, teleporting, trampolines and lobby counts. |
| NPC Follow | A NavMesh agent simulated by one owner and sent to everyone. |
| Image Loading | Showing a picture from a URL on a sign. |
| Minimap | A top down camera following the local player onto a render texture. |
| Persistence | Saving and loading a player's progress. |
| Settings Tab | Adding world options to the player's menu. |
| Day Night Cycle | A sun on the shared server clock, no networking needed. |
| Round Timer | A synced countdown from one message per round. |
| Trivia Quiz | Questions from a JSON file with the current question synced. |
| Server Best Time | Per player saves on the server with BasisServerStorageShim. |
| Staff Door | A door for admins and moderators that updates live. |
| Voice Stage | Playing a speaker's voice from stage speakers. |
| Drawing Board | A shared whiteboard with compressed late joiner snapshots. |
| Random Loot | The same random item for everyone with no messages. |
| Elevator | A shared moving platform from one synced number. |
| Tail Reaction | An avatar reacting when its jiggle bones are grabbed. |
| Hand Flashlight | Pinning an object to the hand without lag. |
| Desktop and VR Input | One script for mouse clicks and VR triggers. |
| Localized Sign | Text in the player's language. |
| Performance Scaler | Cutting effects when the frame rate drops. |
| Server Portal | Sending players to another server. |
| Boids | 200 birds animated with one batched call per frame. |
All examples are also in the Unity editor under Basis > Creator Guide, where each code block has a copy button.
Edit on GitHub
Last updated on