A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'AR' started by tdmowrer, Aug 29, 2019.
Great! Thanks @tdmowrer I’ll look into it.
@tdmowrer I can confirm that having a button toggling focusmode works on iOS. However setting it at in the settings or setting it by script on Start() does not affect it at all. At what time should I set the focusMode to fixed for it to take effect?
Hard to say, since it looks like we're wading into undefined behavior territory. I would setup a coroutine to set the autofocus a few frames after the camera is enabled and experiment with the timing.
Yeah, that's pretty broken. It will be fixed in 3.0.0-preview.4
For now, you can work around this by giving the ARCamera a non-identity transform. Set its X position to be 0.001, for instance. This will trigger the correct code path. For this to work, make sure you're using the TrackedPoseDriver with the "Use Relative Transform" checkbox checked.
Is there an ETA on when ARFoundation will be completely out of the development/ preview phase, and will have full support for all the ARKit 3 features?
Verified (non-preview) packages are tied to specific Unity releases, so the next verified release will be 2020.1. The current ARFoundation 3.0.0-preview packages are the preview of this release.
Thank you very much for the heads up on this
Building a simple AR project for iOS under Windows 10, with the help of iOS Builder, fails because of AR Foundation 3.0.0 Preview 4:
My "solution": downgrading to last stable versions:
AR Foundation from 3.0.0 Preview 4 to 2.1.4
AR Subsystem from 3.0.0 Preview 4 to 2.1.1
AR Core from 3.0.0 Preview 4 to 2.1.2
AR Kit XR Plugin from 3.0.0 Preview 4 to 2.1.1
What version of Xcode? In ARFoundation 3.0, we can target either Xcode 10 or Xcode 11. We do this based on what you choose in the Build Settings. However, on Windows, you can't pick a version of Xcode (since it is not installed) so we always pick Xcode 11.
The errors you posted look like linker errors I would expect to get if building with Xcode 10 and linking against an Xcode 11 lib.
When using the latest preview packages and Unity 2019.2.10f1 and I try to run the ARKitFaceBlendShapes scene, I am greeted with an error pink shader on the entire screen. Did I go wrong somewhere?
This is what xcode spits out:
So this seems to be an issue (as expected) with the background shader. So when I check out the shader. I get the following:
The editor.log just repeats the same message (they're in more shaders, so might be something unrelated to ARFoundation)
Seems to be an issue with the shader compiler on Catalina: https://issuetracker.unity3d.com/issues/ios
Thanks for your reply. This makes totality sense to me. I think iOS Builder is using XCode10. Don't know if it sometimes support XCode11.
With ARfoundation's SimpleAR scene, the rotation of the Placed Prefab is zeroed out when the scene starts. And when you move the object onto a tracked plane, the object's rotation does not dynamically change to match the rotation of that plane. The rotation of the object remains frozen. I'm wanting to write a script where the Placed Prefab will match the rotation of the tracked plane it's resting on. Is there a way to do this?
How AR Foundation is connected to New XR Platform? There is not enough information at this moment on Unity YouTube. I found something on Oculus Connect, but there are no mentions about AR Foundation. Please clarify it.
just set the rotation of the placed object to hitPose.rotation;
I tried using addressables for updating ImageLibrary but it didn't work out of the box on android with ARFoundation. What aspects of addressables you'd like to engage with XR? Assets and scenes are easily loaded with addressables regardless of XR setup.
We're having problems building using BuildPipeline.BuildPlayer() with com.unity.xr.arkit-3.0.0-preview3 and com.unity.xr.arkit-3.0.0-preview4.
We get an error about the Xcode 10 and Xcode 11 variants of UnityARKit.a colliding.
Plugin 'UnityARKit.a' is used from several locations:
Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1100/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
Please fix plugin settings and try again.
We've had a PreBuildProcessor script that tries to delete the Xcode 10 variant of the .a file from Library/PackageCache, which seems to work sometimes...
Note also that the paths the Editor is complaining about are in the (virtual) Package directory.
This is the pre-build step:
public class PreBuildProcessor: IPreprocessBuildWithReport
public int callbackOrder => 0;
public void OnPreprocessBuild(BuildReport report)
// Remove build-breaking Xcode 10 version of UnityARKit.a
File.Delete(Application.dataPath + "/../Library/PackageCachefirstname.lastname@example.org/Runtime/iOS/Xcode1000/UnityARKit.a");
File.Delete(Application.dataPath + "/../Library/PackageCacheemail@example.com/Runtime/iOS/Xcode1000/UnityARKit.a.meta");
// Hmmm. Our build logs say that Unity is attempting to access /Packages/com.unity.xr.arkit/Runtime/iOS/... so let's
// try that?
File.Delete(Application.dataPath + "/../Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a");
File.Delete(Application.dataPath + "/../Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a.meta");
However it doesn't work anymore...
I guess I'll have to fork the package and remove the file?
Has anyone seen anything similar?
OK. I was able to fix it by copying com.unity.xr.arkit-3.0.0-preview.4 into the Packages directory, and removing the offending Xcode 10 variant of the .a.
Thanks for your help, but I tried that, and unlike hitPose.pose, ARRaycastHit does not contain a definition for 'rotation'.
Did you try to implement this into the existing PlaceOnPlane script?
public class PlaceOnPlane : MonoBehaviour
public GameObject ground;
private GameObject _spawnedObject;
private static readonly List<ARRaycastHit> Hits = new List<ARRaycastHit>();
private ARRaycastManager _raycastManager;
private ARPlaneManager _planeManager;
private void Start()
_raycastManager = GetComponent<ARRaycastManager>();
_planeManager = GetComponent<ARPlaneManager>();
private void Update()
if (StatusTracker.GameStarted) return;
if (!TryGetTouchPosition(out var touchPosition)) return;
if (!_raycastManager.Raycast(touchPosition, Hits, TrackableType.PlaneWithinPolygon)) return;
if (Input.touches.Select(touch => touch.fingerId).Any(id => EventSystem.current.IsPointerOverGameObject(id))) return;
var hitPose = Hits.pose;
_spawnedObject = StatusTracker.SelectedRobot;
_spawnedObject.transform.position = hitPose.position;
_spawnedObject.transform.rotation = hitPose.rotation;
ground.transform.position = hitPose.position;
ground.transform.rotation = hitPose.rotation;
StatusTracker.ActiveRobots[StatusTracker.CurrentIndex] = _spawnedObject;
private static bool TryGetTouchPosition(out Vector2 touchPosition)
if (Input.touchCount > 0)
touchPosition = Input.GetTouch(0).position;
touchPosition = default;
This is from the current project (I don't instantiate objects, I pool them for performance).
@tdmourer We are working with an AR tool that loads images references and object references at runtime.
I saw that images now can be loaded for tracking at runtime. Good.
But what about object tracking? Can I add them at runtime?
If not, will it be added later?
Skybox Material missing in iOS build
loads images references at runtime worked,
But the tracking is not stable, even if I don't move, it will bounce back and forth.
Delete button incorrect in unity2019.3.0b10
Our game based on ARFoundation 3.0 preview 4 used to build just fine on Unity Cloud Build. However, very recently we started getting this error:
9058: ▸ ⚠;️ ld: Could not find auto-linked framework 'QuickLookThumbnailing'
9059: ▸ ❌; ld: symbol(s) not found for architecture arm64
9060: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)
We're using Unity 2019.2.11 and XCode 10.2 on UCB. Did something change in XCode or UCB recently that caused this error to suddenly appear?
There's also a thread about it here:
However, after much googling I'm starting think the error is coming from ARFoundation, so that's why I'm asking here.
Thank you very much in advance for all help.
With body tracking, is it possible to track from just the waist up? Or does it need to detect the entire body to instantiate?
release notes on the new version?
When I start the ARCoreFaceRegions scene on the Sony Xperia XZ Premium, the permission is requested but afterwards the camera screen remains black. But on my Google Pixel 2 it works fine.
Sony Xperia XZ Premium
Can anyone confirm the problem?
With ARKit body tracking, you will have to have almost the entire body to start initiate tracking.
I may have run into a bug: ARFoundation 3.1.0 and Unity 2019.2.13f1 and ios 13.? on an iPhone 11 Pro - @tdmowrer or @todds_unity
I am tracking the face using the forward camera while using video / plane tracking from the rear camera. When I turn off the Plane Manager to start facial tracking - the video feed flips temporarily to the forward camera and then just.......pauses.....giving me roughly 30 of these errors in the Xcode console:
Error pushing pixel buffer to VIO: InvalidCalibrationData
Session did fail with error: ..... "World tracking failed" NSLocalizedFailureReason= World tracking cannot determine device's position
private void StartWorldTracking()
FaceManager.enabled = true;
PlaneManager.enabled = true;
HumanBodyManager.enabled = false;
private void StartFaceTracking()
FaceManager.enabled = false;
PlaneManager.enabled = false;
FaceManager.enabled = true;
I'm calling "StartFaceTracking()" to flip the camera. Note that I disable the FaceManager first before enabling it again (assuming maybe its a weird session bug causing the issue). I've also tried leaving it enabled. I've also tried explicitly enabling it even if its already enabled. All have the same issue.
For Plane Manager: I'm not subscribed to any of the events. The scene has a face manager, plane manager, raycast manager, and a quickly disabled body manager with 3d pose estimation checked.
Hi - we've noticed this as well and seems to be an issue in ARKit. It is reproducible in any of the ARKit 3-supported preview packages (and also in simpler test cases I've made). If you restart the session that should workaround the issue, so you can try doing that whenever you switch between modes.
Thanks for the note! Based on this I've tried several combinations of setting my (Face/Plane/etc.)Manager off/on and ARSession.Enabled true/false with an ARSession.Reset thrown in for good measure and haven't been able to fix it. Is there a secret sauce to the order?
when are you planing to add support for HoloLens and MagicLeap with ARFoundation?
Is there any (rough) time estimation already?
I am using unity 2019.2.14, and I have set ARKit as optional from Edit > Project Settings > ARKit Build Settings.
But I am getting the following error.
BuildFailedException: You have selected a minimum target iOS version of 10.0.0 and have the ARKit package installed. ARKit requires at least iOS version 11.0 (See Player Settings > Other Settings > Target minimum iOS Version).
Strange if AR Foundation support on device are assumed to be compulsary that would be wild for try to deploy for device limitations like older devices?
I need to mimic the marker + extended tracking feature that Vuforia has, but using latest ARFoundation instead.
Would I simply be using ARKit's Image tracking feature?
Also, any tips on a updating a 3 year old Unity 5.6 Vuforia based project to latest version of would be appreciated!
Documentation for image tracking in AR Foundation may be found here:
Additionally, the AR Foundation samples project contains an example scene that does image tracking.
I'm using Unity2019.2.16f1, ARFoundation 3.1.
Since I've updated the ARFoundation (from v2.2), I'm having problems detecting the Toch.Began, which starts a simple Physics.Raycast.
It was working okay in previous version, and the function was being called in the "Update" cycle. Using the AR 3.1, the function stopped to work. Calling it in the "FixedUpdate" cycle I have some result, but not always. It's strange, but it seems that sometimes it don't get the Touch.Began (my guess).
It's probably related with the cycles sync.
Any hints on the subject would be appreciated.
AR Foundation does not affect the UnityEngine.Input.GetTouch() functionality.
In ARFoundation 3, can I load ARKit 3d object tracking ".arobject" file at runtime?
Regarding the error I mentioned, I solved the problem calling my function in the "LateUpdate" cycle.
Still seems to me that it can be some cycle sync problem, my function is based only on the following events
if (Input.touches.phase == TouchPhase.Began)
if (Input.touches.phase == TouchPhase.Moved)
and have some strange behaviour when calling from Update or FixedUpdate.
Anyway, thank you, the advances with the ARFoundation 3.1 are great!
I'd like to confirm this too. Seemed the object tracking functionality was pulled from ARFoundation 3.0.x?
Has anyone loaded anchors from an ARKIT WorldMap?
Please use the preview packages (3.1.0-preview.1 or later).
object tracking not working in ar foundation 3.0.1 ?
You need to import 3.1.0-preview.1, as stated below by @todds_unity
Hi @todds_unity , is object tracking going to have the same feature as image tracking ("Adding new reference image at runtime")? I asked this here before, but didn't receive an answer by Unity yet.
I am working in an AR authoring tool that needs to add object tracking reference objects at runtime, but we are stuck with ARKIT 2.0 because it is possible only with UnityARKitPlugin (deprecated) and not with ARFoundation.
The API allows you to change out, at runtime, the entire reference object library for a new one. See the ARTrackedObjectManager.referenceLibrary property.
However, the ability to change out add a single object to an existing object library does not exist yet.
Any update on ARCore cloud anchor? I'm using ARKit world mapping now and wondering if ARCore cloud anchor is available. It would be good if ARFoundation would use crossplatform serialize worldmapping.