Overview
Level
BEGINNER
Topology
CLIENT HOST & SHARED AUTHORITY

Download Page
Download the Asteroids Unity project
Getting Started
Step-by-step guide to run the sample in the editor and online
Architecture
Project structure and a code walkthrough of the key game systems
Asteroids is a top-down arcade shooter for up to four players. Each player flies a spaceship, shoots asteroids that break into smaller fragments for points and has three lives. The round ends when its timer runs out or every ship is out of lives. It is a beginner sample for developers who completed the Shared Mode Basics tutorial.
The sample ships as two separate Unity projects, one for Client Host and one for Shared Authority, see the Download page. The Client Host project suits developers who completed the Host Mode Basics tutorial.

Features
- Complete game loop: menu, pre-game screen, a 180 second round, winner screen and return to the menu
- Big asteroids that break into three to five small asteroids when hit, 2 points for a big and 1 point for a small asteroid
- Three lives per spaceship, a respawn delay and a short shield after each spawn
- Projectiles stored as data in a networked array with local bullet visuals, see Projectiles Essentials
- Asteroid pooling with a custom
NetworkObjectProviderDefault, see NetworkObjectProvider - Master client authority over the asteroids and the game state, hit requests through RPCs and local hit prediction in the Shared Authority project, see Shared Mode Master Client and RPCs
- Network input, client-side prediction and lag compensated hit detection in the Client Host project, see Client-Server Player Input and Lag Compensation
Third Party Assets
The Asteroids sample uses the following third party asset:
- Exo 2 font by Natanael Gama under the SIL Open Font License 1.1
- Boom 2 sound by D.S.G. under CC0 1.0
- Retro, Laser Shot 01 sound by LilMati under CC0 1.0
- 100 CC0 SFX #2 sound pack by rubberduck under CC0 1.0
Last updated on
Back to top