Skip to content

hathora/unity-ngo-2d-space-shooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2D Space Shooter sample game (Unity NGO + Hathora Cloud)

UnityVersion NetcodeVersion

This sample game was started from Unity's Netcode for GameObjects Bitesize Samples

Overview

The original 2D Space Shooter Sample was a UNet sample that has been converted over to NGO. Check it out to learn more about physics movement and status effects using Netcode NetworkVariables and ObjectPooling. We have made a few modifications to make this game easily deployable with a dedicated server on Hathora Cloud.


Readme Contents and Quick Links

Click to expand/collapse contents


Getting the project

Direct download

  • select Code and select the 'Download Zip' option. Please note that this will download the branch you're currently viewing on Github

Requirements

This sample game is compatible with the latest Unity Long Term Support (LTS) editor version, currently 2021 LTS. Please include Linux Dedicated Server Build Support in your installation, as well as Linux Build Support (Mono).

PLEASE NOTE: You will also need Netcode for Game Objects to use these samples. Complete the Hello World tutorial to prepare your environment.

You will also need to have an account created for Hathora Cloud (sign up at: https://console.hathora.dev)

Steps to deploy and integrate Unity NGO game with Hathora Cloud

Note: steps 1 - 3 have already been completed as part of this sample

  1. Add Hathora Cloud Unity Plugin to your project
  2. You must add a script to enable your dedicated server to automatically start in "Server" mode. See NetworkCommandLine.cs
  3. Then, attach the new script to the NetworkManager game object in the scene. This enable the script to listen for command line arguments configured (-mode server).
  4. Use the Hathora Unity plugin to configure, build, and deploy your server on Hathora Cloud (for more detailed steps, check out this guide).
  5. Once deployed, create a room in Hathora Cloud (via plugin or Hathora Console
  6. Run your game client and enter in the connection information shown (note: you will need to convert the hostname to an IP address (i.e. dig hnzpvf.edge.hathora.dev in your terminal)

Troubleshooting

Bugs

  • Report bugs in the sample game using Github issues

Documentation

For a deep dive into Hathora Cloud, visit our documentation site.

Community

For help, questions, advice, or discussions about Netcode for GameObjects and its samples, please join our Discord Community. We have a growing community of multiplayer developers and our team is very responsive.

Other samples

Photon Fusion BR on Hathora Cloud

Hathora Cloud + Photon Fusion Dedicated Server is a minimal example of getting a dedicated server working with Photon Fusion.

Hathora Unity Plugin

Hathora Unity Plugin (with FishNet and Mirror demos) is our Unity Plugin that comes with FishNet and Mirror networking demos. It allows you to deploy your game on Hathora Cloud directly from our editor plugin.