using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AttackCone : MonoBehaviour {
public TurretAI turretAI;
public bool isLeft = false;
void Awake()
{
its here -----> turretAI = gameObject.GetComponentsInParent();
}
void OnTriggerStay2D(Collider2D col)
{
if(col.CompareTag(“Player”))
{
if(isLeft)
{
turretAI.Attack(false);
}
else
{
turretAI.Attack(true);
}
}
}
}