I’m trying to make an enemy AI and need to detect if the player is in the range collider but there is already a collider on the enemy to detect bullets. How do I specify which collider to use to detect the player?
(one is a box collider one is a capsule)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DetectPlayer : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
Debug.Log("Detected");
}
}
}
}