Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How do I get autocomplete for Unity scripts in VScode?

Discussion in 'Scripting' started by BreeadHead, Jun 12, 2023.

  1. BreeadHead

    BreeadHead

    Joined:
    Jun 4, 2023
    Posts:
    2
    When I tried adding the VScode module to version 2022.3.1f1, it tries to install the community 2022 version. I want to use the normal version, so I went to the unity editor, then preferences, and set the editor to the Code.exe file of my vscode. However, I still am not getting any autocomplete. I'm doing the "Essentials of programming in Unity" tutorial, and after typing "transform." there should be a list of properties and methods with the transform, but nothing shows up. What can I do to get autocomplete for this?
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,084
  3. BreeadHead

    BreeadHead

    Joined:
    Jun 4, 2023
    Posts:
    2
  4. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,378
    I should point out that VSCode and Visual Studio are 2 completely different programs.
    https://visualstudio.microsoft.com/

    It's annoying that Microsoft called them such similar names. But so it goes.

    Visual Studio - an IDE (integrated development environment) with a huge suite of tools to facilitate development.
    Visual Studio Code - a light weight "code editor" that is intended to be less feature rich out of the box, but highly customizable, as well as very light weight.

    Note that Visual Studio (not code) has many versions underneath that. And that's where "Community Edition" comes in, it's the free to use version of the IDE as long as you reach certain requirements (basically, you're not an enterprise... a large company earning lots and lots of money):
    https://learn.microsoft.com/en-us/a...l-studio-community-edition-commercial-use-and

    I mention this because VSCode is not the "normal version" of the software. It's a completely different application all together. There is no "normal version"... there's "Community Edition", "Professional", and "Enterprise" all with varying license agreements and pricing (community being the "free" one).

    There's even a 3rd application in that link above called "Visual Studio for Mac" which is yet a completely other application. It basically being an updated and reskinned MonoDevelop.

    As for getting autocomplete in VSCode... maybe start here:
    https://code.visualstudio.com/docs/other/unity

    Ryiah did point out that the package from unity for easy direct support is deprecated. But this doesn't necessarily mean it's not possible. You just might have to put in some leg work... per how VSCode usually works. Being the lightweight "code editor" that it is, you need to sort of tweak it to your specific needs.

    Visual Studio on the other hand is the full suite software with very well maintained support from Unity.

    Personally... I prefer Visual Studio for Unity development.
     
    Ryiah likes this.
  5. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,043
    I am a VSCode user. I am still on 2021 until I can secure a good workflow with 3rd party tools.