From f83d853e5dd810f6226a697e8e0815db206253cb Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 14 Sep 2026 06:59:01 +0200 Subject: [PATCH] Fix default value in Editor when it's `null` for value-type --- Source/Editor/CustomEditors/Values/ValueContainer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Editor/CustomEditors/Values/ValueContainer.cs b/Source/Editor/CustomEditors/Values/ValueContainer.cs index c8d44b32a..b9bd66623 100644 --- a/Source/Editor/CustomEditors/Values/ValueContainer.cs +++ b/Source/Editor/CustomEditors/Values/ValueContainer.cs @@ -297,6 +297,11 @@ namespace FlaxEditor.CustomEditors else if (Type.Type == typeof(long)) _defaultValue = Convert.ToInt64(_defaultValue); } + else if (_defaultValue == null && Type.IsValueType) + { + // Use zero value for value-types that have null as default value for some reason + _defaultValue = Type.CreateInstance(); + } } } if (instanceValues._hasReferenceValue)