UnityScript not recognizing NetworkServer "Unknown Identifier"

So I’ve been tinkering with this script now for multiple days and can’t get it to work. My problem is that I’ve coded the rest of my scripts up until this point in Unity JavaScript, no C# at all, just because I call variables from one script to another pretty often and that doesn’t work very well from C# to JavaScript or vise versa.

So now that I’m working with networking, and the documentation is practically non-existent in the scripting API, and the manual seems to use C# exclusively, I’m a bit lost…

My script is set as:

public class “scriptname” extends Networking.NetworkBehaviour

This is because Unity throws an error when I don’t add “Networking” which is fine except the same holds true across the board. This creates a problem when I need to run a command as when I add @Networking.Command Unity refuses to recognize any “Networking.” anything in the function, and removing Networking doesn’t help either…

I know my explanation is really jumbled, but maybe I’ll post the script if it’s needed. I just want to make sure this isn’t just a bug or something I can fix with a simple reinstall…

Are you familiar with the concept of namespaces? The new network classes are inside a seperate namespace called “Networking”. If you want to use a class from a namespace you either have to use the full classname including the namespace (just as you found out yourself) or, which is the common way, place an “import” statement at the top of your script file. In C# it’s called “using”.

import UnityEngine.Networking;

Same applies to the new UI system which has it’s classes in the UnityEngine.UI namespace.

If you look at the docs of NetworkBehaviour at the very top, right after the class name is states:

class in UnityEngine.Networking /
Inherits from: MonoBehaviour