Hello,
First of all I’m new to Godot so I apologize if I’m asking a stupid question.
I have installed Godot.Net and having /Net 8 installed already, my understanding is that it should work out of the box, but seems not to be the case.
Following the Godot tutorial, seems like I should have a Build button for my c# scripts, which doesnt exist. Also from project settings I can’t find any .Net related tab. From the plugins installed the list is also empty, even tho I can see a GodotSharp folder under my Godot installation folder.
When I try to run the game (with one script created) I always get an error "E 0:00:01:940 can_instantiate: Cannot instantiate C# script because the associated class could not be found. Script: ‘res://Scenes/Player.cs’. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it’s case-sensitive).
<C++ Error> Method/function failed. Returning: false
<C++ Source> modules/mono/csharp_script.cpp:2340 @ can_instantiate()
"
Which seems to be is caused by some issue with the .Net setup.
Any ideas? What did I miss?
You need to go to Tools, and you’ll see an option to create the C# project. Once you did that, build your project for the first time, then everything should work.
Thanks! Ye there’s an option to “Create C# solution” and that fixed my error and I can run the project.
Yet I still don’t see any plugins or .Net tab in project settings, is that expected? Im using Godot 4.4.1
Are you using the Mono version of Godot? The normal version does not support C#
I think yes, I downloaded then “Godot Engine -.NET” version, still I don’t see any .NET reference in the Project settings or plugins.
What reference are you expecting to see? If you add a script to a node, are you able to switch between GDScript and C# to pick the language? If so, you’re good to go.