using System.Collections; using System.Collections.Generic; using UnityEngine; public class ShootingRange : MonoBehaviour { public float range = 5f; public LayerMask playerLayer; public bool inRange = false; void Update() { } private void OnTriggerEnter2D(Collider2D collision) { inRange = true; Debug.Log("in range"); } private void OnTriggerExit2D(Collider2D collision) { inRange=false; } }