using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestUICamera : MonoBehaviour {
private Camera cam;
// Use this for initialization
void Start () {
cam = UICamera.currentCamera; //changing the camera to UICamera Here.
}
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0))
{
Vector3 point = cam.ScreenToWorldPoint(Input.mousePosition);
Debug.Log(" pos is :" + point);
}
}
}