// ProjectileDamage.cs using UnityEngine; public class ProjectileDamage : MonoBehaviour { public float damage = 10f; void OnTriggerEnter(Collider other) { if (other.TryGetComponent(out var target)) { target.ApplyDamage(damage); } Destroy(gameObject); } }