godotengine / godotengine/godot
C# Exported Array<Node> is null
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3 stable
### System information
Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 Ti (NVIDIA; 31.0.15.3623) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)
### Issue description
I have a larger project, that uses C# for all the scripts. Everything works fine when I start the game from the editor. When I export it, I get several errors, that I was able to trace back to that an exported variable is null, instead of being set to the value that is stored in the scene.
This applies to exported variables, that are made of a Godot.Collections.Array, where can be Node or any other Script that inherits from Node.
If I replace the Array with Node[], the export is working fine.
### Steps to reproduce
Unfortunately, I was not able to create a MRP, as the issue did not persist in a minimal project. So unfortunately, I do not know how to reproduce, but I can share the code with one or two people who want to investigate the issue.
### Minimal reproduction project (MRP)
I was not able to create a MRP and don't want to publically share my project, but I can share the code with one or two persons who want to investigate the issue.
Contributor guide
Research direction
Start by reviewing the provided C# usage of Godot.Collections.Array and comparing it with Node[] in an exported project, using the shared code or project if available. Confirm the behavior in an exported Godot v4.3.stable build; done means exported Array variables retain the values stored in the scene.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100