I narrowed down the problem to a simple OverlapBox call with hardcoded values for a box in the center of the scene. I have no ideas on what might be the problem, I might be missing something. Here is the code for the test system:
[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
[UpdateBefore(typeof(PhysicsSystemGroup))]
public partial struct TestPhysicsSystem : ISystem
{
public void OnCreate(ref SystemState state)
{
}
public void OnDestroy(ref SystemState state)
{
}
public void OnUpdate(ref SystemState state)
{
var physicsWorld = SystemAPI.GetSingleton<PhysicsWorldSingleton>().PhysicsWorld;
var collisionWorld = physicsWorld.CollisionWorld;
var worldCenter = new float3(0, 0.5f, 0);
var worldHalfExtends = new float3(0.5f, 0.5f, 0.5f);
var worldRotation = quaternion.identity;
var hitboxesLayer = 7;
var hurtboxesLayer = 8;
var outHits = new NativeList<DistanceHit>(Allocator.Temp);
if (collisionWorld.OverlapBox(worldCenter, worldRotation, worldHalfExtends, ref outHits, new CollisionFilter { BelongsTo = (uint)hitboxesLayer, CollidesWith = (uint)hurtboxesLayer }))
{
Debug.Log("hit!");
}
}
}





