0 votes


i use c#, and i want to know :

-1- i build an helper class, but i can't access my helperClass namespace in the nodeScripts...??

-2- and, how can i add references in a godot project ??

-------------------- EDIT --------------------
Ok , for the point -1-, i got it : i have to create the file.cs in the Godot EDI, not in VSCode (or i must manually update the MyProject.csproj file)

in Engine by (20 points)
edited by

2 Answers

+1 vote
Best answer

In Godot 3.0.2,m when using C#, you can use an IDE that lets you update the C# solution when adding files (like MonoDevelop or VisualStudio. Perhaps VSCode has a way to do it as well with a plugin?).
C# is not like GDScript, it needs a project file to be compiled. So if you use a text editor without project management you indeed need to do that manually, or force Godot to recreate or update the solution somehow.

Adding references is the same. If you have an IDE that lets you update the project file, then I believe you can add them that way.

by (29,042 points)
selected by
0 votes

I wanted to add a class like this:

public enum State

public class Cell
    public int Row;
    public int Column;
    public int Index;
    public State State;

    public Cell(int row, int column, int index)
        Row = row;
        Column = column;
        Index = index;
        State = State.Idle;

How do you do it in Godot?

I created Cell.cs with File -> New in the scripting window - it insisted I derive from a Godot class like Node. So, I let it do that, then I removed the Node reference and made my classes like above. That got me an extra set of classes.

I don't know the answer to adding references to external assemblies.

by (259 points)

Hello, I've got the same problem. Could you find a solution? I'd like to work from VisualStudio without the need of creating "Scrips" manually from Godot app

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.