diff --git a/EntitiesSamples/Assets/Miscellaneous/ClosestTarget/TargetingSystem.cs b/EntitiesSamples/Assets/Miscellaneous/ClosestTarget/TargetingSystem.cs index e30eaa421..d038ac0fd 100644 --- a/EntitiesSamples/Assets/Miscellaneous/ClosestTarget/TargetingSystem.cs +++ b/EntitiesSamples/Assets/Miscellaneous/ClosestTarget/TargetingSystem.cs @@ -138,7 +138,7 @@ public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useE } Scratch.Neighbours.Clear(); - Tree.GetEntriesInRangeWithHeap(unfilteredChunkIndex, transforms[i].Position, float.MaxValue, + Tree.GetEntriesInRangeWithHeap(-1, transforms[i].Position, float.MaxValue, ref Scratch.Neighbours); var nearest = Scratch.Neighbours.Peek().index; targets[i] = new Target { Value = TargetEntities[nearest] };