The "using" command isn't working in Microsoft Visual Studio

I am new to unity and am trying to set up a multiplayer vr game using normcore.io . I have had a running problem where tutorials on youtube will tell me to type a “using” command at the top of the script with some related text after it. When they type this command they are given tons of auto complete stuff and new commands related to what they are trying to code. When I do it nothing happens. Is there any easy fix for this?

The “using Normal.Realtime;” command is what I’m working on right now and as far as i can tell it looks identical to the tutorial.

This is the tutorial:

The part relevant to this is at 5:55.

So that “using” statement is this:

Basically there is a lot of code out there that has already been written for you. This code is often delivered to you in what is called a “library”.

For example .net itself has a massive library (it’s all the using System.**** that you see). Unity also has a large library that is specific to their game engine (the using UnityEngine, and UnityEditor that you may see).

These libraries can also be sub divided down (like System.Collections vs System.IO, where one is for collection types, and the other for in/out operation helper types).

These are all called “namespace”. Think of it like this… there could be 2 types out in the world called Object (System.Object and UnityEngine.Object). If you just said “Object” we wouldn’t know which you’re referring to. So a namespace is like a “full name” for that type. It’s like a surname for you and I. There could be 2 Bob’s, but their full names could be Bob Smith and Bob Johnson.

Now… it would be really annoying though having to type out the entire full name every time you wanted to use one of the types.

The “using” at the top lets the compiler know “hey, when I say Object, look in these namespaces for it”.

Now:

Well, since we don’t know exactly what you’re seeing, it could be many things.

For example you might not have the appropriate library in your project. From the looks of the tutorial being from normcore.io, and normcore having a Noral.Realtime here:
https://normcore.io/documentation/reference/realtime.html

I’m willing to bet that’s the library. Did you important the library?

If you have… it could be an issue with Visual Studio/Visual Code/whatever IDE you’re using. Visual Studio I’ve seen behave weird with Unity and drop its intellisense randomly. I usually just restart VS for it, or it fails cause some unrelated code is failing to build. Visual Code often needs some extra setup. Other IDEs could have a bunch of causes.

We sort of need more info on what you’re seeing in you IDE to better guess at what the cause might be.

1 Like