diff --git a/Assets/Scripts/Players/Player.cs b/Assets/Scripts/Players/Player.cs index d46f81c..6a65034 100644 --- a/Assets/Scripts/Players/Player.cs +++ b/Assets/Scripts/Players/Player.cs @@ -179,6 +179,7 @@ namespace NeonTea.Quakeball.Players { Vector3 From = CameraRoot.position; Vector3 Direction = CameraRoot.forward; RaycastHit[] Hits = Physics.RaycastAll(From, Direction, 1000f, BulletHitLayer); + System.Array.Sort(Hits, (a, b) => { return a.distance.CompareTo(b.distance); }); foreach (RaycastHit Hit in Hits) { ShotDelta = Hit.point - GunPoint; Player Player = Hit.rigidbody != null ? Hit.rigidbody.GetComponent() : null;