#Global "Cannot Instantiate" Error

5 messages · Page 1 of 1 (latest)

nova bison
#

I'm trying to make a simple Autoload global scene (Godot 4.5, C#) and I keep getting this error when I run:

can_instantiate: Cannot instantiate C# script because the associated class could not be found. Script: 'res://Scripts/Global/Global.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).

My script, the class, the node, and scene are all named exactly the same: Global with a capital "G". No idea why it's not working.

My Global.cs:

using Godot;
public partial class Global : Node
{
    public static Global Instance { get; private set; }
    public override void _Ready()
    {
        Instance = this;
    }
}
nova bison
#

Global "Cannot Instantiate" Error

#

Changed the names in case there was a conflict with some Global keyword, but same result 🙁

split rampart