using UnityEngine;
public class DynamicCrosshair : MonoBehaviour
{
public GameObject crosshair;
MouseOver mouseOverScript;
void Start() {
mouseOverScript = FindObjectOfType<MouseOver>();
}
void OnTriggerEnter(Collider jennyCollider)
{
if(jennyCollider.tag == "Player" && mouseOverScript.mouseOver == true)
{
Debug.Log("Both true");
crosshair.SetActive(true);
}
else
{
Debug.Log("TriggerTag Player but no mouseOver");
crosshair.SetActive(false);
}
}
void OnTriggerExit(Collider jennyCollider)
{
Debug.Log("TriggerExit");
crosshair.SetActive(false);
}
}