Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Static Class and Static Functions don't work in 4.1 #81956

Closed
Skeletoneyes opened this issue Sep 20, 2023 · 1 comment
Closed

C# Static Class and Static Functions don't work in 4.1 #81956

Skeletoneyes opened this issue Sep 20, 2023 · 1 comment

Comments

@Skeletoneyes
Copy link

Godot version

4.1.1.stable.mono.official

System information

Windows 11 - v4.1.1.stable.mono.official [bd6af8e]

Issue description

I am unable to reference C# static classes or static functions in GD Script.

Looking up tutorials for this workflow, it seems to have been trivial in Godot 3.x using preload to create a reference to the static class.

Several other posts and threads suggest this is broken in 4.X. I have tried things like ensuring the script is in the .csproj and nothing has worked.

When I try this in the latest version of Godot I get an error saying that Godot can't find the function I'm calling: Invalid call. Nonexistent function 'Foo' in base 'CSharpScript'.

Simple example project attached.

Steps to reproduce

Create a c# script using Godot.
Define a static class with a public static function.
Create a 2d scene node and attach a gdscript to it.
In that GDScript create a reference to the static class
Attempt to call the public static function using that reference.

Minimal reproduction project

StaticClassProj.zip

@raulsntos
Copy link
Member

@raulsntos raulsntos closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants