Is there anyway to make the below code work for a mouse click instead of a touch?
I have tried all sorts of things however i keep getting errors in my code.
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch (0);
if (touch.position.x < Screen.width/2)
{
//Move Player Left
}
else if (touch.position.x > Screen.width/2)
{
//Move Player Right
}
}
else
//Do nothing for now
}
Any help would be much appreciated.
Still a newbie