Aframe mobile can't detect orientation of the device - iphone

I'm working on a project with A-Frame. My problem is that when I open from my iPhone (model Xs Max) even the easiest example code moving the device will not change the camera rotation. But when i go to https://aframe.glitch.me/ this one works even if it is the same code. The device motion and orientation is enabled in iPhone settings. What am I missing?

Related

App accelerometer behaves differently when plugged into Xcode

Working on game where you move ship by titling screen.
Using Landscape right mode.
If device not flat the ship moves so i needed to calibrate the Y tilt when the app is run so that is neutral up/down movement.
I got it to work by reading the tilt when app was run and making that neutral.
Anyway, it works fine (took me hours to figure it out but I did it!)
It works great when I have my iPhone plugged in to MacBook and run it through Xcode.
But if I run it when the phone is not connected to Xcode - it does not work.
It acts like the calibration I set up was not even there.
I set it up to catch the Y tilt angle when you launch the app "view did load".
Works great when plugged in but not when not plugged to Xcode.
I tried force quit-relaunch, even reset phone and launch app again.

unity PC build settings screen resolution doesn't work?

i'm trying to run with my own resolution so I inserted the resolution in the build settings. However, when I build it and run, there is no screen resolution option for the one I inserted. I want to build with screen by 9:16(common mobile resolution) but there are only ones like 10:9 or 16:9.
I search on Google and they told me to go to 'Edit'->'Player'->'Player Settings' but there is no 'Player' in mine.
Can anyone tell me how to set up resolution?
9:16 and 16:9 aspect ratios are the same so you should be fine by using 16:9 and changing the screen orientation.
You can read more on the screen orientation here and you can set it in Player Settings if you build for mobile platforms. [Edit -> Project Settings -> Player is the right path.]
Screen orientation is platform specific and only appears when you build for mobile platforms (Android, IOS...). You can set it as you like or you can use AutoRotation value as well - in that case the device will determine how to display your game.

Unity app with different screen orientations

I'm developing a game that runs on both mobile phones and tablets.
Currently I'm using only the Portrait orientation for all devices but the portrait orientation looks better on phones meanwhile landscape orientation looks better on tablets.
I set "Portrait" option in the Unity's Player Settings > Resolution and Presentation > Default Orientation but I would like to provide a landscape layout for tablets (without affecting phones).
How I can I do that? Is there any why to programmatically set the Screen orientation when the application starts?
You can try Screen.Orientation
In the Start (or Awake) method of a MonoBehaviour that is added to the stage call:
Screen.Orientation = ScreenOrientation.LandscapeRight
Now you just need to check if the device is tablet or phone, I don't know any way out of the box to do this, but you can check the aspect ratio and base your decision on this.
You can check the aspect ratio by getting Screen.width and Screen.height.

Locking orientation in unity3d game for ASUS (windows) tablet through code?

How can i lock orientation for unity 3d game through code? This is for Asus tablet.
You do this through the Editor in Player Settings.
Player Settings -> Resolution and Presentation -> Resolution: Default Orientation
Edit: Here is a picture.
I believe you can manually set the orientation like so:
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.Portrait;
iPhoneSettings should apply to all portable devices, not just iOS. For some reason the screenOrientation variable isn't defined in the documentation and it doesn't show up in MonoDevelop's intellisense.

How do I emulate changing the orientation of my android device?

I'm working in Eclipse using the Android SDK and Android ADT plugin, and I have some functionality based on phone orientation that I want to test in the emulator (more specifially, I want to verify my solution to this problem).
How do I emulate the orientation change?
If you mean,switching during runtime,than:
.Switch to previous layout orientation (for example, portrait, landscape): KEYPAD_7, Ctrl-F11
.Switch to next layout orientation (for example, portrait, landscape): KEYPAD_9, Ctrl-F12
Is that what you need?