1

So a couple of days ago, I installed vscode for working with the Unity game engine scripts, however, even though I installed the C# extension, it won't show the arguments for each function, for example, if I write an AddForce() function, vscode doesn't show what kind of arguments should I put inside the parenthesis. How can I get it to do so?

Say, it won't show the arguments for AddForce() in this code I wrote:

using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
    public Rigidbody rb; //References the player's Rigid Body component as "rb"

    void Update()
    {
        rb.AddForce();
    }
}

Also, vscode shows this error whenever I load a script from my Unity project:

Error Image

Ksawery
  • 21
  • 4
  • Welcome to SO, [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) would let others to help you faster. In the other hand, you should post your class and `AddForce` and a minimum use code snippet on post. – Louis Go May 26 '20 at 01:10

2 Answers2

1

So at the end, I installed the SDK that can be found at: https://dotnet.microsoft.com/download/dotnet-framework/thank-you/net471-developer-pack-offline-installer and now Intellisense is working perfectly and I can see the arguments for each function properly. Also, I directly opened the folder where my Unity project scripts were at and apparently that helped too.

Ksawery
  • 21
  • 4
0

Maybe this? Need a project.json file or *.sln in your project. https://stackoverflow.com/a/29979730/13616364

Milo Todt
  • 44
  • 2
  • Well, my Unity project folder does have a *.sln file, however, when I try to open it with vscode, arguments still don't show up, and same goes for trying to open the folder in which the *.sln file is contained... – Ksawery May 26 '20 at 00:30
  • Do you have multiple? You may need to select a specific one (as in the guide above) if VScode is confused which it should use. – Milo Todt May 26 '20 at 01:27
  • multiple? As in multiple *.sln files? Nope, there's only one on my Unity project folder. Also, sorry if I don't follow too much on this. I'm new to programming and all.. – Ksawery May 26 '20 at 02:07