something like
if (Input.GetKeyDown(KeyCode.A))
{
Input.deviceOrientation = DeviceOrientation.LandscapeLeft;
}
is this possible?
something like
if (Input.GetKeyDown(KeyCode.A))
{
Input.deviceOrientation = DeviceOrientation.LandscapeLeft;
}
is this possible?
Not sure if that’s what you want to achieve but you could change resolution in game panel upper left corner to any resolution that is landscape, like 1920x1080 or other? That way you can see how your game looks in landscape mode.
The device orientation is read only, you cannot simulate it, but you don’t need to. The value is taken from the Unity Remote device attached when running in the editor.
the reason I’m asking this is because I have this strange situation going on with Google VR. I have a clipboard object that player spawns with, and carry around, but when the device rotates upside down, vr camera rotates as well. The thing is, so does clipboard object. I think this is happening due to VR keep overriding any camera related stuff.
I’m trying to find a way NOT to do this, but everytime I try something I need to build and test. And Unity Remote doesn’t always work in my case, too. So I’m trying to find a way to simulate device rotation in Editor instead of keep re-building and opening xcode which takes enormous amount of time .
Like said before it is readonly. When running in the editor Input.deviceOrientation is unkown, so like Moonjump said it is probably only working with a remote device.
I need to simulate device orientation, because I want to recalculate stuff when orientation is changed. Any ideas?
sry reviving this old post, but what works for me is using the Simulator Tab
it changes when you change the orientation by code
and to any person trying to find a solution for this ;D
Nice. Good to hear there is a solution. I don’t remember what project this was for, but eventually we didn’t need it anymore or we simply used simulator.