Hello. How to determine the position (vertical, horizontal) mobile / tablet code?
the position of what?
I think the word you’re looking for is “orientation”, not “position”, such as landscape (the phone is on it’s side) or portrait (straight up)
So decided.Just me more for the PC should have.
void Update () {
if (Screen.width < Screen.height)
{
if (currentOrientation != “Vertical”)
{
currentOrientation = “Vertical”;
print(“Vertical”);
}
}
else
{
if (currentOrientation != “Gorizontal”)
{
currentOrientation = “Gorizontal”;
print(“Gorizontal”);
}
}
}