private void OnTriggerEnter2D(Collider2D collision) { CameraAnimation spotted = gameObject.GetComponentInParent <CameraAnimation>(); if (collision.gameObject.tag == ("Player")) { spotted.Spotted(); } }