diff --git a/Scripts/Weapon.cs b/Scripts/Weapon.cs index 9115fb1..f4e052e 100644 --- a/Scripts/Weapon.cs +++ b/Scripts/Weapon.cs @@ -27,12 +27,13 @@ namespace GameDev.CoreSystems var position = BarrelEndPoint.position; var forward = BarrelEndPoint.forward; var ray = new Ray(position, forward); - Debug.DrawRay(position, forward * 10, Color.green); if (Physics.Raycast(ray, out RaycastHit hitInfo)) { if (hitInfo.transform.TryGetComponent(out Targetable target)) { + Debug.DrawRay(position, forward * Vector3.Distance(position, target.GetCenterPosition()), + Color.red, 0.1f); target.Damageable.ModifyHealth(Mathf.RoundToInt(-Damage)); } }