Tested versions
- Reproducible in: v4.4.stable.mono.official [e36cb51]
System information
Redot v4.4.stable.mono - macOS Unknown (26.2.0) - Multi-window, 2 monitors - Metal (Forward+) - integrated Apple M4 (Apple9) - Apple M4 (10 threads)
Issue description
When using Godot.Collections.Dictionary<string, T> where T is a class that inherits from GodotObject (such as Container), the dictionary returns null values at runtime even though the values are properly set in the Redot editor.
Expected behavior:
The dictionary should return the actual Container objects that were assigned in the editor. The output should display the container objects with their proper string representations.
Example expected output:
container1: Container:<Container#12345>
container2: Container:<Container#67890>
Actual behavior:
The dictionary returns null for all values, even though the keys are present and the values were set in the editor.
Actual output:
container1: null
container2: null
Additional context:
- The issue specifically occurs when the value type
T in Dictionary<string, T> is a class that inherits from GodotObject
- The keys in the dictionary are accessible and correct
- Only the values are returning
null
- This appears to be a serialization/deserialization issue with GodotObject-derived types in dictionaries
Steps to reproduce
- Create a C# script that inherits from a Godot node (e.g.,
Control)
- Add an exported field of type
Godot.Collections.Dictionary<string, Container> where Container is a class inheriting from GodotObject
- Populate the dictionary in the Redot editor with key-value pairs
- Access the dictionary values at runtime in the
_Ready() method
- Observe that the values are
null instead of the expected Container objects
Code example:
using Godot;
public partial class TestGodotDictionary : Control
{
[Export] private Godot.Collections.Dictionary<string, Container> _containers;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
foreach (var container in _containers)
{
GD.Print($"{container.Key}: {(container.Value == null ? "null" : container.Value.ToString())}");
}
}
}
Minimal reproduction project (MRP)
godotdictionaryreturnnull_2025-12-22_16-45-28.zip
Tested versions
System information
Redot v4.4.stable.mono - macOS Unknown (26.2.0) - Multi-window, 2 monitors - Metal (Forward+) - integrated Apple M4 (Apple9) - Apple M4 (10 threads)
Issue description
When using
Godot.Collections.Dictionary<string, T>whereTis a class that inherits fromGodotObject(such asContainer), the dictionary returnsnullvalues at runtime even though the values are properly set in the Redot editor.Expected behavior:
The dictionary should return the actual
Containerobjects that were assigned in the editor. The output should display the container objects with their proper string representations.Example expected output:
Actual behavior:
The dictionary returns
nullfor all values, even though the keys are present and the values were set in the editor.Actual output:
Additional context:
TinDictionary<string, T>is a class that inherits fromGodotObjectnullSteps to reproduce
Control)Godot.Collections.Dictionary<string, Container>whereContaineris a class inheriting fromGodotObject_Ready()methodnullinstead of the expectedContainerobjectsCode example:
Minimal reproduction project (MRP)
godotdictionaryreturnnull_2025-12-22_16-45-28.zip