Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Visual Studio not using highlighted syntax for Unity classes

Discussion in 'General Discussion' started by Hannahham10, May 20, 2019.

  1. Hannahham10

    Hannahham10

    Joined:
    Jul 7, 2017
    Posts:
    12
    Hey, so I installed Unity recently and have been trying to figure out how I can use preferably Visual Studio to use syntax highlighting/intellisense for Unity classes and their framework.

    No success yet, Unity apparently has no actual support email for general questions like this, and I made another thread awhile back with no response yet.

    I guess if this continues I won't be developing in Unity after all...

    Thanks for reading this.
     
  2. chris_gamedev

    chris_gamedev

    Joined:
    Feb 10, 2018
    Posts:
    18
    I have had very mixed success with IDEs over time with Unity.

    The editor that I have had the most success with is actually Visual Studio Code.

    upload_2019-5-20_17-40-12.png

    There is a Unity specific guide for setting it up, here:

    https://code.visualstudio.com/docs/other/unity

    It's also worth noting that opening up just a random script directly from a file may leave Intellisense in a non-functional or incomplete state, so I tend to always open the code via Assets > Open C# Project. It might be worth checking if that's actually your current issue with full VS - I think the full project/solution needs to be opened for full IDE functionality.

    But, honestly, I'm a big fan of Visual Studio Code as a general text/code editor and it's working great for me right now for Unity development so likely to be sticking with it :)
     
    Hannahham10 likes this.
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    11,769
    What have you tried?

    I allowed Unity to install Visual Studio from its installer. Then I open a Unity project. From the Unity Editor, I double-click a script file in the Project panel and it opens in Visual Studio, with syntax highlighting, intellisense, and so on.

    Which part of that doesn't work for you? When it goes wrong, what is wrong?

    For what it's worth, the General Discussion section is specifically labelled as not being a support area. Scripting would be the place to post this type of thing.
     
    Hannahham10 likes this.