-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
When exporting a enum with no zero value defined, the editor takes the wrong default value #76933
Comments
Can you reproduce this in GDScript? |
Well I thought it was a c# bug, but seens like it's not - @Calinou yes it also happens on GDScript.
|
Duplicate of #74123 (and I'm pretty sure this is discussed in other issues, but I can't find them easily, GitHub search is failing me). It's indeed a known design issue with the way enums work and the fact that exported variables get zero'ed by default, even if their export hint limits the valid range to something that doesn't contain zero. |
Godot version
4.1.0-dev.1
System information
Win10
Issue description
Export a enum without a value defined for 0 can create a visual bug in the editor that makes the default value wrong.
Godot consider the default value of all exported enums to be always 0, but a enum dont necessary will have a 0 defined.
So by default it assumes all enum always start with 0, but since the enum dont have a 0 it shows the first element instead, but it dont actually use its value.
Steps to reproduce
Create a c# enum with no zero value and other class that export that enum.
Example:
Minimal reproduction project
EnumBugDefault.zip
The text was updated successfully, but these errors were encountered: