You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot v4.2.1.stable - Windows 10.0.26120 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Plus Graphics () - Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 Threads)
Issue description
Here, I have a custom resource that has a default value in code, but I want to assign a null value using the editor. I noticed that when I tried to set the exported property of my custom resource to <empty> that, upon viewing with the debugger, the property value had reverted back to the default value at runtime. I would expect the value to be null at runtime.
It seems like Godot reads properties in custom resources as the default properties of the resources. This seems to conflict with the behavior of native Godot classes, which read <empty> values set in the inspector as null values.
Steps to reproduce
Open the Minimal reproduction project
Place a breakpoint at line 8 in main.gd
Run the project, it should reach the breakpoint
Inspect the value of stack variable invisible_weapon
Note how invisible_weapon's weapon_icon property is not null as expected
Tested versions
Reproducible in 4.2.1.stable [b09f793]
System information
Godot v4.2.1.stable - Windows 10.0.26120 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Plus Graphics () - Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 Threads)
Issue description
Here, I have a custom resource that has a default value in code, but I want to assign a
![image](https://private-user-images.githubusercontent.com/72361968/342005302-edf45cbd-ad6d-47dd-97d4-30c8bcf03046.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzM3ODYsIm5iZiI6MTcyMTEzMzQ4NiwicGF0aCI6Ii83MjM2MTk2OC8zNDIwMDUzMDItZWRmNDVjYmQtYWQ2ZC00N2RkLTk3ZDQtMzBjOGJjZjAzMDQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAy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n0.fm9C5jA_HTB-J5-pOMe1GQzxQt8WGH1yVD2FVjUuTuU)
null
value using the editor. I noticed that when I tried to set the exported property of my custom resource to<empty>
that, upon viewing with the debugger, the property value had reverted back to the default value at runtime. I would expect the value to benull
at runtime.It seems like Godot reads properties in custom resources as the default properties of the resources. This seems to conflict with the behavior of native Godot classes, which read
<empty>
values set in the inspector asnull
values.Steps to reproduce
invisible_weapon
invisible_weapon
'sweapon_icon
property is notnull
as expectedMinimal reproduction project (MRP)
MRP.zip
The text was updated successfully, but these errors were encountered: