RF0107: Entity references belong on Entity components
A Resource script tries to export a reference to a tree Entity.
For a C# project using Reckfell.NET.Sdk 1.0.0. Fix the first build error first: later messages may be a consequence.
Cause
A Resource script tries to export a reference to a tree Entity.
Fix
Store the reference on an Entity component. If the object must remain a Resource, store settings, a prefab or a path and resolve the instance in gameplay code.
Failing example
Save the file in a test C# project and run dotnet build. This version intentionally fails to build.
Example.cs
using Reckfell;
namespace DiagnosticExamples.RF0107;
public partial class Example : Resource { [Export] public Entity? Target { get; set; } }Expected messages: RF0107.
Working version
Replace the failing version with these files; do not keep both declarations in the project.
Example.cs
using Reckfell;
namespace DiagnosticExamples.RF0107;
public partial class Example : Entity { [Export] public Entity? Target { get; set; } }Result
Target accepts an Entity reference. The reference belongs to an Entity instance rather than a Resource.
Related material
Reckfell Engine documentationBack to top ↑