Question by
MechanicalGaming · Dec 07, 2015 at 11:02 PM ·
c#androidscreen resolutionscreen size
Phone app Resolution and Screen Size
Hey everyone!
I'm having this trouble with a game that I am making. It's a shooter where you must tap on the screen to make the turrets move towards the x,y of the click (finger). I instantiate an invisible box that the turrets can use the look function to aim at. The works flawlessly with my phone (480*800) but when I try it out on another phone that has a different pixel resolution the pointer changes place and so the shots are higher and/or more to the left or right.
I tried using this line of code to fix this error but sadly it doesn't. Anyone got any ideas how to fix this?
Thanks guys!
Code (mp = mouse position): mp = new Vector3(Input.mousePosition.x / (Screen.width / 480), Input.mousePosition.y / (Screen.height/800), 15f);
Comment