I want to test my Script in Desktop as well as touch/tablet environment. Therefore I need to convert mouseinputs into Touch in my script. I tried:
var screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);
Touch touchZero = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);
It says Cannot implicitly convert type UnityEngine.Vector3' to
UnityEngine.Touch'
Any chance to convert the type somehow so I do not have to write everything twice?
You can build a touch from mouse input like this: