My goal is to have a app with characters running at you and you dodging but I want it to be universally good for tablets and phones. Preferably C# but java script is fine. What i want is having the character spawn at random position between the left edge of the screen and the right.
vector3 v3Left = new Vector3(-0.15f, .5f, 10); //10 is the distance from the camera
v3Left = Camera.main.ViewportToWorldPoint(v3Left);
vector3 v3Right = new Vector3(Screen.width,0,0);
v3Right = Camera.main.ScreenToViewportPoint(v3Right);
v3Right = new Vector3(v3Right.x, .5f, 10);
v3Right = Camera.main.ViewportToWorldPoint(v3Right);
For me, this worked v3Left.x is the left edge of the screen and v3Right.x the right edge.