Am i doing correctly ? the sphereCastHits length is always 0. it hitted nothing.
{
public CollisionFilter filter;
public float neighbourRadius;
public void Execute(ref FlockAgent flockAgent, in LocalTransform localTransform, in PhysicsWorldSingleton physicsWorldSingleton)
{
NativeList<ColliderCastHit> sphereCastHits = new NativeList<ColliderCastHit>(Allocator.TempJob);
var resultOfSphereCast = physicsWorldSingleton.SphereCastAll(
localTransform.Position,
neighbourRadius,
float3.zero,
0,
ref sphereCastHits,
filter
);
flockAgent.neighbourCount = sphereCastHits.Length;
}
}```