reckfellENGINE

RF0101: Export does not support static

Static belongs to a type, while exports store instance state.

On this page

RF0101 is an enabled-by-default build error: Export is applied to a static field or property. Exported state belongs to an object instance; static state belongs to the C# type.

Reproduce

Save as ExportExample.cs:

C#
using Reckfell;

public partial class ExportExample : Entity
{
    [Export] public static int Score { get; set; } = 10;
}

Fix according to intent

For a value belonging to each Entity, remove static and retain Export. For intentionally shared C# state, retain static and remove Export. This complete example shows both:

C#
using Reckfell;

public partial class ExportExample : Entity
{
    [Export] public int Score { get; set; } = 10;
    public static int SharedScore { get; set; } = 42;
}

The fixes have different semantics: removing static changes shared state into per-instance state. Do not apply that change blindly to global counters or services. Removing Export means the static property is no longer an exported property; it does not provide Inspector editing or serialization for shared state.

Verify the result

Create two ExportExample instances. Changing Score on the first must not change the second. In the native check, Score was changed through the engine property binding, SharedScore stayed static and was absent from the exported property list. Packing and instantiating a level retained the changed exported Score.

If the error remains, inspect both fields and properties for Export and check that the file was saved before rebuilding. Do not suppress RF0101 to obtain an apparently successful build: suppression does not turn static state into an exportable instance property.

The exact invalid example was rejected and the fixed instance/serialization behavior was executed. Native Inspector interaction, hot reload and all exportable member types were not tested here.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.