godotengine / godotengine/godot
Cannot export C# array of type Vector2I, Vector3I, Vector4I: "GD0102: The type of the exported field is not supported"
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.2.2 stable
### System information
Windows 10, Godot 4.2.2 stable
### Issue description
In the [manual](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_exports.html), it says:
> C# arrays can exported as long as the element type is a [Variant-compatible type](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_variant.html#c-sharp-variant-compatible-types).
Vector2I, Vector3I, and Vector4I are listed as [Variant compatible types](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_variant.html#c-sharp-variant-compatible-types) in the manual.
However, when trying to export e.g. an Vector2I array, Godot gives the error: "GD0102: The type of the exported field is not supported"
### Steps to reproduce
Create a C# script with the line:
> [Export] private Vector2I[] testI;
then try to compile.
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by reproducing the error with the C# script line `[Export] private Vector2I[] testI;` in Godot 4.2.2, then trace the C# export validation for array element types and compare it with the manual's Variant-compatible type list. Done means Vector2I, Vector3I, and Vector4I arrays are accepted consistently with the documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100