Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity: "NetworkBehaviour" is missing

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.

like image 571
Alvin Stefanus Avatar asked Oct 19 '25 05:10

Alvin Stefanus


1 Answers

For Unity 2020, I used Window > Package Manager and pressed the + (plus) sign: Add Package from git URL and set it to:

  • com.unity.multiplayer-hlapi

and

  • com.unity.xr.legacyinputhelpers

as it was recommended here: https://medium.com/@jeffreymlynch/where-are-the-missing-preview-packages-in-unity-2020-3ad0935e4193

like image 63
Zeghra Avatar answered Oct 22 '25 04:10

Zeghra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!