I have a sprite which is moving up , and in the code i also have the part if the scree is touched this sprite should change its derection to left, but instead it just goes a bit left and afterward it goes up again.
void Update()
{
transform.position += Vector3.up * Time.deltaTime;
if (Input.GetMouseButton (0)) {
transform.position+=Vector3.down *Time.deltaTime;
}
}