Code inspection: Boxing is not supported
Unity's Burst compiler does not support boxing value types into object or interface references. This can happen when a struct or primitive is implicitly converted to object, passed to an API that expects object, or otherwise treated as a managed reference.
Example
In this example, the value integer is assigned to an object variable inside a Burst-compiled job. This operation requires boxing and is not supported.
using Unity.Burst;
using Unity.Jobs;
[BurstCompile]
public struct ExampleJob : IJob
{
public int value;
public void Execute()
{
// Reported: Boxing operations are not supported in Burst
object boxed = value;
}
}
using Unity.Burst;
using Unity.Jobs;
[BurstCompile]
public struct ExampleJob : IJob
{
public int value;
public void Execute()
{
// Keep the value in its original unmanaged form
int copy = value;
}
}
Quick-fix
This inspection does not provide a dedicated quick-fix. Fix it manually by removing the boxing conversion and keeping the code on Burst-compatible unmanaged types.
26 March 2026