void OnTriggerStay2D(Collider2D col)
{
///get position of click
clickPosition.x = Camera.main.ScreenToWorldPoint(Input.mousePosition).x;
clickPosition.y = Camera.main.ScreenToWorldPoint(Input.mousePosition).y;
///currently, click must be on player
if (col.tag == "Player" && ((Input.GetKeyDown(KeyCode.Space)) || (col.OverlapPoint(clickPosition) && Input.GetMouseButtonDown(0))))
{
if (exit != null)
{
cameraScript.follow = false;
cameraScript.target = exit.transform;
}
else
{
Debug.Log("no exit assigned");
}
Debug.Log("Teleport Complete!"); // confirm that teleport is complete; this can be taken out
TeleportToExit2D(col);
}
/*
else
{
//cameraScript.follow = true;//allows smooth transition for each teleport
}
*/
}