Search code examples
c#unity-game-enginevisual-studio-2019

Intellisense Not Recognizing Data Type


I am new to both C# and Unity. Very new.

I created a new C# script and I'm trying to add the following line:

public Vector3 direction = Vector3.up

When I go to type in Vector3, my only option that has anything with Vector in it is "BitVector32".

I am using a 3D object in Unity.

What do I need to do?

Edit: I am using the following:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Edit:

  1. I have confirmed Visual Tools for Unity is installed.
  2. I am using UnityEngine at the top.
  3. Below is the code I am using. All I am trying to figure out is why

intellisense does not recognize Vector3 sense it is a data type. It recognizes "BitVector32" but not "Vector3" though, when I run this code, everything works fine.

using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using UnityEngine;

public class Mover : MonoBehaviour
{
    // Vector3 is unique to UnityEngine

    public Vector3 direction = Vector3.up;

    float speed = 0.1f;

    void Update()
    {
        var movement = direction * speed;

        this.transform.Translate(movement);
    }
}

Solution

  • I may be a little late to this, but I've had the same problem. What worked for me was to go in Unity, go to the top left and select Edit->Preferences and open the External Tools tab. In there the first option should be External Script Editor. Make sure you've selected Microsoft Visual Studio 20xx. Intellisense should get a hold of Unity specific objects and data types and be able to recognise things like Vector3.