Skip to content

Commit e2659af

Browse files
committed
fix(Util): mutate list in physics sort
1 parent c484fc1 commit e2659af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Physics.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ public static class JCS_Physics
8585
/// <param name="hits"> A list of raycast hits. </param>
8686
public static RaycastHit[] SortHitsByDistance(Vector3 point, RaycastHit[] hits)
8787
{
88-
hits.OrderBy((hit) => Vector3.Distance(point, hit.point));
89-
return hits;
88+
return hits.OrderBy((hit) => Vector3.Distance(point, hit.point)).ToArray();
9089
}
9190

9291
/// <summary>

0 commit comments

Comments
 (0)