-
-
Notifications
You must be signed in to change notification settings - Fork 23.7k
Description
Tested versions
Reproducible in:
- v4.4.stable.mono.official [4c311cb]
- v4.5.1.stable.mono.official [f62fdbd]
- v4.6.dev4.mono.official [bd2ca13]
System information
Godot v4.5.1.stable.mono - Windows 11 (build 26200) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 32.0.15.8157) - AMD Ryzen 7 3700X 8-Core Processor (16 threads) - 31.92 GiB memory
Issue description
Exported flag enum properties appear correctly in the Inspector, but default values assigned via auto-property initializer are ignored.
The Inspector displays all checkboxes as unchecked.
This causes a functional problem:
The true “all-off” state becomes impossible to select because the Inspector already shows it due to the incorrect initialization.
Example:
[Export]
public MyFlags Mode { get; set; } =
MyFlags.A | MyFlags.D;Expected:
The Inspector should show “A” and “D” as checked according to the default.
Actual:
All checkboxes are shown unchecked, ignoring the default value.
Steps to reproduce
- Create any Node script in C# using a [Flags] enum.
- Add an exported auto-property with a default initializer combining multiple flags:
[Export]
public MyFlags Mode { get; set; } = MyFlags.A | MyFlags.D;- Attach the script to a node.
- Open the node in the Godot Editor’s Inspector.