Skip to main content

Install Netcode for GameObjects

This guide details how to install Unity Netcode for GameObjects (Netcode) via the Unity Hub.

This guide assumes that you already have:

  • An active Unity account with a valid license.
  • A current installation of Unity.
  • An existing Unity project. If you haven't created a project yet, we recommend using the Hello World example to begin.

Unity 2021.x+#

  1. Open your Unity Hub and select the Project you are presently working on.

  2. From the menu bar, navigate to Window > Package Manager.

  3. Click the plus sign Add in the Package Manager status bar and select Add pack from name...

    Package Installed

  4. Copy and paste the following in the pop-up window:

com.unity.netcode.gameobjects
How to Copy

We recommend that you use the Copy function in the code block above to copy the URL as other methods may result in errors. Just hover and click.

  1. Click Add. The package installs, shown as Netcode for GameObjects Version 1.0.0-pre.2.

    Package Installed

Unity 2020.3.x#

To install Netcode on Unity versions 2020.3.x, use the Unity Package Manager passing a git URL to the Netcode release:

  1. Open your Unity Hub and select the Project you are presently working on.

  2. From the menu bar, navigate to Window > Package Manager.

  3. Open the Unity Package Manager by navigating to Window > Package Manager on Unity’s main menu.

  4. Click Add in the status bar and select Add package from git URL...

    Select Git URL Option

  5. Enter the Git URL to the Netcode release package (below). You can click the Copy option in that codeblock and paste it in the Package Manager.

    com.unity.netcode.gameobjects
    How to Copy

    We recommend that you use the Copy function in the code block above to copy the URL as other methods may result in errors. Just hover and click.

  6. Click Add. The package installs, shown as Netcode for GameObjects Version 1.0.0-pre.2.

    Package Installed

Next Steps#

See the following content to continue your journey using Netcode:

Troubleshooting#

You may come across different errors when installing Netcode. The following troubleshooting tips should help you with the most common issues.

Errors with incorrect package loading#

If you receive a different package than Netcode for GameObjects Version 1.0.0-pre.2 when adding the URL to Unity Hub, you may have not correctly copied the GitHub URL.

Hover over the URL to copy, click the Copy function in the code block, and use this when adding the package from a Git URL in Unity Hub.

Errors adding package

MacOS users may receive the following errors:

  • Cannot perform upm operation: Unable to add package... Error when executing git command. xcrun: error: invalid active developer path
  • Error adding package...

These are common errors for MacOS users that have not installed or updated Xcode or Xcode developer tools. You may need to upgrade your Xcode installation. In a terminal, use this command: xcode-select --install.

If you newly installed or updated Git, you may also need to restart your system. Restarting Unity may not be enough if you added Git and could receive a package loading error.

Errors finding Git installation

If you receive an OS or Unity error trying to locate Git after updating or installing Git, you need to fully restart your computer. Restarting only Unity may not fully update system information to correctly locate the install.

VPN or Proxy Errors

If you use VPN or proxy software from international locations, you may encounter access issues. Use the registry option for installing MLAPI. Also consider turning off your VPN service or selecting a different location.

Package Resolution Error when using a Git Dependancy referencing an Annotated Tag in its Git URL

For more information on this error please refer to Unity Issue Tracker.