If double-clicking a script opens the wrong app, start with this preference. Reinstalling an IDE or rewriting a script will not correct a selection that still points elsewhere.
Check one existing script before changing integrations
Open a practice project and locate a C# script in Unity's Project window. Note its path under Assets, then double-click it after changing the preference. The selected editor should open that same file.
For a fictional equipment-training scene, use a harmless comment to distinguish the intended copy:
Assets/Training/EquipmentNotice.cs
// Editor path check: media desk scene
Add that comment to the practice script, save it, then reopen the script from Unity. Confirm both the path and the comment. A file with the same name in another checkout can otherwise make the editor appear to ignore your changes.
The preference belongs to the Unity Editor's settings area. Use the menu path for your operating system rather than looking for it among the scene's Inspector properties. Preferences reference
Separate opening a file from understanding a Unity project
An editor can open a .cs file as text while failing to recognize Unity types. Unity documents Visual Studio, Visual Studio Code, and JetBrains Rider integrations. Check the setup for the application you actually selected.
For Visual Studio Code, Unity 6.0's documented setup includes:
- The C#, C# Dev Kit, and Unity extensions in VS Code.
- Unity's Visual Studio Editor package, version 2.0.20 or later.
- VS Code selected as the External Script Editor.
The package name is easy to misread: com.unity.ide.visualstudio supports VS Code as well as Visual Studio. The older com.unity.ide.vscode package is no longer supported in these instructions. Match the guidance to your installed Unity version before changing packages.
For Visual Studio, check Visual Studio Tools for Unity and Unity's Visual Studio Editor package. For Rider, check Unity's JetBrains Rider package. Choosing a different executable does not install these integrations.
If the editor opens but diagnostics look wrong
First confirm that the editor opened the project associated with the running Unity instance. Unity maintains solution and C# project files for its Visual Studio integration; those files describe the project to the external tools. Opening an isolated script is a different context from opening its project.
Then read Unity's Console. An actual compilation error in Unity needs a source correction even if the external editor has no red underline. An editor-only warning needs investigation in that editor's project and extension setup. Keep those observations separate when asking a teammate for help.
If the editor no longer appears after moving or reinstalling it, reselect its installed application through External Tools and repeat the single-file check. Keep a note of the Unity version, selected editor, and relevant package versions so the next person can reproduce the setup.
Finish with a saved change in the intended project
Remove the temporary path-check comment when the file locations agree. Save the script and return to Unity to inspect compilation results. For a later debugging task, follow Unity's debugging setup for that IDE; successfully opening the file establishes only the editor selection.