Closed sam598 closed 3 years ago
Please log a bug by following these instructions: https://unity3d.com/unity/qa/bug-reporting
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It's not a bug with Unity, it's an unexpected behavior in AR Foundation, either caused by ARKit or AR Foundation's interpretation of ARKit.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am writing this with the full understanding that this feature is not officially integrated. I wanted to call this out for whenever it is.
When using the following script in the SimpleAR scene, ARKit aligns the camera so that the scene's Z+ axis is aligned with the device's understanding of North.
The EnableGeoAnchors example uses
subsystem.requestedWorldAlignment = ARWorldAlignment.GravityAndHeading;
as well. However the resulting behavior is very different.Instead a moment after the scene starts, the camer's world Z+ axis will be 90 degrees to the right of wherever the camera is facing when the scene starts. This arbitrary positioning consistently happens in every direction.
This can be tested by placing an object at position (0,0,3) and observing it's position change.
The good news is that the GeoAnchors behave as expected. Their position and rotation relative to the camera is consistent, and the anchor's local Z+ axis always faces North.
I am not sure if this is expected behavior from ARKit, or something internal with how ARFoundation interprets the camera pose. But ideally the camera's world Z+ axis would be consistently facing North.
Tested with an iPhone 12 Pro Max, iOS 15 beta 1.