I am working on a mobile project and I am trying to have one of the scenes take advantage of the inverted portrait orientation. When I build and run the application on an iPhone SE and a Samsung Galaxy S8+, the orientation does in fact behave as expected; however, on a Samsung Galaxy S5, it falls back to the normal portrait orientation. The documentation has led me to believe that it should work on the Galaxy S5 considering both the phone and the Minimum API Level I have set in the player settings (Android 4.1) met the Android 2.3+ requirement of the inverted portrait orientation. Below is the script setting the orientation in case that should matter, but as previously mentioned, the other two phones I am using for testing don’t have an issue.
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed;
private float movement;
private Vector3 movementV3;
void Start ()
{
Screen.orientation = ScreenOrientation.PortraitUpsideDown;
Screen.sleepTimeout = SleepTimeout.NeverSleep;
}
void FixedUpdate ()
{
movement = Input.acceleration.x;
movementV3 = new Vector3 (movement, 0, 0);
GetComponent<Rigidbody2D>().AddForce (movementV3 * speed);
}
}
Any information about why this isn’t working or how to fix it would be greatly appreciated.