- Home /
Question by
zenyogi · Dec 14, 2020 at 11:30 AM ·
unity input
Not Getting actual touch position ,Getting (0.0, 1.0, 0.0) on every touch
Code:
void Update()
{
if(Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
Vector3 touchPos = Camera.main.ScreenToWorldPoint(touch.position);
touchPos.z = 0f;
Debug.Log("touchPos : " + touchPos);
}
}
Comment
You might as well use Input.mousePosition
instead of touch.position. This works for me @zenyogi