I am new to unity3d, Right now i am adding a cube as game object with coordinate 0,0,0 But when i run it on android device Iam facing 2 problem a) Coordinate system of unity3d are different from coordinate system of device, For device top left is 0,0 but for unity center of the screen is 0,0. How to fix that mismatch or i need to multiply with some factor to make it work.
b) Iam moving the object on x-axis this is what iam doing for moving object on x-axis
if(xback){
xaxis+=(2*Time.deltaTime);
if(xaxis >Screen.width/2){
xback = false;
}
}
else if(!xback){
xaxis-=(2*Time.deltaTime);
if(xaxis<=-(Screen.width/2)){
xback = true;
}
}
Vector2 temp = transform.position;
temp.x = xaxis;
temp.y = yaxis;
transform.position = temp;
But the problem iam facing is as soon as my xaxis equals 9 it touches the right of screen and then it get out of screen, so iam little bit confuse is unity3d pixel system is different from the one on device, because iam moving the cube by one pixel every time but movement is not equal to 1 pixel of device. so i want to know is pixel system of unity is different from pixel system of android or iam doing something wrong.