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

Default C# script naming system can cause invalid class name #42149

Closed
rick551a opened this issue Sep 17, 2020 · 1 comment · Fixed by #44515
Closed

Default C# script naming system can cause invalid class name #42149

rick551a opened this issue Sep 17, 2020 · 1 comment · Fixed by #44515

Comments

@rick551a
Copy link

rick551a commented Sep 17, 2020

Godot version: 3.2.3 mono stable

OS/device including version: Windows 10 x64

Issue description:

1) Create a new scene by right clicking file dock & selecting New Scene...

2) In the popup for scene name, enter a name with spaces (e.g: "my scene")

3) Now create a new .cs script in this new scene. Use the defaults.

4) As the .cs file loads in editor observe red squiggly error lines as the class name is now
my scene : Node2D
A class name cannot have a space.

Maybe to resolve this the new script dialog should not allow script names with spaces by default?

Steps to reproduce:

Minimal reproduction project:

@akien-mga
Copy link
Member

Confirmed in 3.2.4 beta 3. Should be fairly easy to solve for anyone interested in Mono editor code.

@akien-mga akien-mga added this to the 4.0 milestone Dec 19, 2020
akien-mga added a commit that referenced this issue Dec 27, 2020
Fixed #42149: bug where the default C# script template would sometimes produce an invalid class name
akien-mga pushed a commit to akien-mga/godot that referenced this issue Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment