Unity: "NetworkBehaviour" is missing

Viewed 6723

I try to run the sample project from google AR Core here.

There is error in the sample code.

error CS0246: The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)

using GoogleARCore;
using GoogleARCore.CrossPlatform;
using UnityEngine;
using UnityEngine.Networking;

/// <summary>
/// A Controller for the Anchor object that handles hosting and resolving the Cloud Anchor.
/// </summary>
public class AnchorController : NetworkBehaviour
{
    ....

I am using the 2020.1.0f1 version. What can I do to fix this? It is said deprecated while the new replacement is still under development.

Deprecated but cannot be used and there is no replacement at the moment. I am stuck here.

3 Answers

use Window > Package Manager to install the Multiplayer HLAPI and XR Legacy Input Helpers packages.

Never mind the Multiplayer HLAPI and XR Legacy Input Helpers only available in unity version < 2020. In 2020 version, there is no option to install them both. The solution is I just downgrade the version into 2019.

Related