Godot Version
v4.6.3.stable.mono.official [7d41c59c4]
Question
I have a very odd problem, that I already had once, but this time it’s even weirder than before. I have an exported property:
[Export] private Godot.Collections.Dictionary<int, Timer> _spawnDelays;
There are 4 elements, and 4 keys exist, but each value is null in code (even at the very first line in _Ready). Even though it is assigned in the editor.
Scene file also looks correct:
_spawnDelays = {
2: NodePath("Timer"),
3: NodePath("Timer2"),
4: NodePath("Timer3"),
5: NodePath("Timer4")
}
I had similar thing happen two times before - upon creating an instance of SceneA in SceneB, one exported property was overriden without my input in the SceneB. It took some time to figure out, but I know it can happen. The issue is that this scene is referenced only in Resource (Scene loads Resource, and then gets internal Scene from the Resource), and you cannot modify scene inside a Resource. Which basically looks like engine discards those values, but I’m quite positive this is not the case.
There are ways to bypass it of course, but it would be less elegant than that. So I would prefer to use this method, since it usually works, but for some reason doesn’t work here.