diff --git a/tutorials/scripting/c_sharp/c_sharp_exports.rst b/tutorials/scripting/c_sharp/c_sharp_exports.rst index d6880f09b69a..085618365efb 100644 --- a/tutorials/scripting/c_sharp/c_sharp_exports.rst +++ b/tutorials/scripting/c_sharp/c_sharp_exports.rst @@ -573,7 +573,13 @@ The default value of Godot dictionaries is null. A different default can be spec Exporting C# arrays ^^^^^^^^^^^^^^^^^^^ -C# arrays can exported as long as the element type is a :ref:`Variant-compatible type `. +C# arrays can exported as long as it not multi-dimensional, and the element type is one of the following: + +.. + See Godot.SourceGenerators.MarshalUtils.ConvertManagedTypeToMarshalType for the function which determines what can be marshalled +* A native C# ``byte``, ``int``/``Int32``, ``Int64``, ``float``, ``double``, or ``string``. +* Anything derived from ``GodotObject``. +* Godot's ``Vector2``, ``Vector3``, ``Vector4``, ``Color``, ``StringName``, ``NodePath``, or ``Rid``. .. code-block:: csharp @@ -583,6 +589,9 @@ C# arrays can exported as long as the element type is a :ref:`Variant-compatible [Export] public NodePath[] NodePaths { get; set; } +Other element types, even other :ref:`Variant-compatible types ` such as ``Plane`` or ``Transform2D``, will not work. +If you get a :ref:`GD0102 ` error, use a ``Godot.Collections.Array`` instead. + The default value of C# arrays is null. A different default can be specified: .. code-block:: csharp diff --git a/tutorials/scripting/c_sharp/diagnostics/GD0102.rst b/tutorials/scripting/c_sharp/diagnostics/GD0102.rst index 3f76f8bb81dd..6b2eb22ce798 100644 --- a/tutorials/scripting/c_sharp/diagnostics/GD0102.rst +++ b/tutorials/scripting/c_sharp/diagnostics/GD0102.rst @@ -1,3 +1,5 @@ +.. _doc_c_sharp_diagnostics_gd0102: + GD0102: The type of the exported member is not supported ========================================================