Migration Guide for Vuforia Engine Unity Projects

This page documents the changes between Vuforia Engine version 9.8 and version 10 as the API has fundamentally changed. Use this overview to learn about the native changes and for migrating your existing projects to the new API.

We recommend reading the Vuforia Engine 10 API page for a general introduction to the new API. For a step-by-step structure for using the Vuforia Engine 10 API, please see Vuforia Engine API in Unity.

Page outline

Changed Distribution Mechanism

The Vuforia Engine 10 package for Unity is no longer hosted on Git. Instead, it is provided as a tarball (.tgz) package that can be added to local projects through Unity’s Package Manager. For your convenience, a .unitypackage can be downloaded from the Vuforia Engine Developer portal that includes the tarball package and automatically adds it to your project when imported. See Vuforia Engine Package for Unity for more details.

High-level Changes

Vuforia Engine 10 API simplifies and reduces the code required to implement common Augmented Reality use cases in Unity applications. At the same time, we are maintaining backwards compatibility wherever possible and ensuring that migration is as simple as possible for your Unity projects. Many Unity applications can be upgraded to Vuforia Engine 10 without requiring any changes, others might require changes to code that uses the Vuforia Engine scripting API in Unity. Follow this migration guide to update Vuforia Engine from 9.8 to 10.0.

Note: If your project only consists of pre-configured Vuforia Engine game objects and settings made in the Vuforia Configuration, just import the new package and you should be good to go (see "Unchanged" below).

Unchanged

  • Any functionality configured through GameObjects in a Unity scene will continue to work as before. For instance, if a Vuforia target GameObject is set up with content in a Unity scene, it will continue to detect, track and augment the target’s child content as in previous Vuforia Engine versions.
  • All settings configured in the global Vuforia Configuration in Unity will continue to be used and don’t need to be adapted for Vuforia Engine 10.0.

Deprecated, but still working

  • The Unity events exposed by the DefaultTrackableEventHandler script will continue to work as before. Please note that the DefaultTrackableEventHandler has been marked Obsolete and replaced with the DefaultObserverEventHandler. It will be removed in a in a future version.
  • Many callback registrations and other APIs accessible statically or through Singletons have been marked deprecated as well. They can still be used and work as before, but they should be changed to ensure compatibility with future Vuforia Engine versions

For example Vuforia Engine 9.8:

VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted)

can still be used, but should be updated to Vuforia Engine 10.0:

VuforiaApplication.Instance.OnVuforiaStarted += VuforiaStarted;

The StateManager class has been deprecated. Its methods should be replaced with the corresponding methods from VuforiaBehaviour.Instance.World.

Vuforia Engine 9.8:

TrackerManager.Instance.GetStateManager().GetActiveTrackableBehaviours()

can still be used, but should be updated to Vuforia Engine 10.0:

VuforiaBehaviour.Instance.World.GetTrackedObserverBehaviours()

Changes that require immediate upgrading

Depending on the application, some code might require a change after upgrading to Vuforia Engine 10.0. This mostly affects code that managed Datasets and Tracker lifecycles as well as scripting code that accessed advanced Vuforia Engine functionality. The high-level changes are summarized below.

See the How to Migrate a Unity project to Vuforia Engine 10 section further down for specific migration steps required for each feature.

Datasets and Tracker lifecycle no longer needs to be managed

The concept of Datasets and Trackers is no longer present in the Vuforia Engine 10 API. Applications no longer need to manage them to control what targets and features are active. Instead, the concept of Observers has been introduced, which can be created e.g., to tell Vuforia Engine that a specific Target should be recognized and tracked. Everything else is handled automatically.

  • Create an Observer to automatically load and activate the target:
ObserverBehaviour imageTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateImageTarget(texture, 0.32f, "MyImageTarget");

For some use cases, it might be useful to load and observe all targets in a certain database. This can be done like this:

IEnumerable<ObserverBehaviour> observers = VuforiaBehaviour.Instance.ObserverFactory.CreateBehavioursFromDatabase("Vuforia/MyDeviceDatabase.xml)");
  • Disable or enable a target to stop it from being tracked or start tracking again:
imageTarget.enabled = false;

Destroy an ObserverBehaviour to unload it. If Observers have been created from a device database – e.g., Model Targets, or Image Targets created on the Developer Portal – destroy the Observers for all targets in that database to free up the memory allocated when it was loaded.

Destroy(imageTarget);

NOTE: Any application code that directly used the DataSet or any of the TrackerManager or Tracker classes will need to be adapted to work with Observers as outlined above.

Simplified access to Target properties and APIs

The TrackableBehaviour base class has been deprecated and replaced with the ObserverBehaviour. Furthermore, the ObserverBehaviour and all subclasses no longer expose a Trackable member. All properties and methods previously exposed through that member object are now directly available through the ObserverBehaviour classes.

Vuforia Engine 9.8:

public void SetModelTargetGuideView(ModelTargetBehaviour mtBehaviour, int guideViewIndex)
{
    string targetName = mtBehaviour.ModelTarget.Name;
    string guideViewName = mtBehaviour.ModelTarget.GetGuideView(guideViewIndex).Name;
    
    Debug.Log("Setting Guide View " + guideViewName + " for " + targetName);
    
    mtBehaviour.ModelTarget.SetActiveGuideViewIndex(guideViewIndex);
}

Vuforia Engine 10.0:

public void SetModelTargetGuideView(ModelTargetBehaviour mtBehaviour, int guideViewIndex)
{
    string targetName = mtBehaviour.TargetName;
    string guideViewName = mtBehaviour.GetGuideView(guideViewIndex).Name;

    Debug.Log("Setting Guide View " + guideViewName + " for " + targetName);

    mtBehaviour.SetActiveGuideViewIndex(guideViewIndex);
}

CurrentStatus is now available at TargetStatus

The CurrentStatus and CurrentStatusInfo properties of the TrackableBehaviour class in Vuforia Engine API 9 has been replaced with the TargetStatus of ObserverBehaviour. It provides access to a target’s status and status info. In addition, you can now subscribe to OnTargetStatusChanged to register changed status on a target directly. See Vuforia Engine API in Unity for details.

Vuforia Engine 9.8:

public void ReadTargetStatus(TrackableBehaviour trackableBehaviour)
{
    TrackableBehaviour.Status status = trackableBehaviour.CurrentStatus;
    TrackableBehaviour.StatusInfo statusInfo = trackableBehaviour.CurrentStatusInfo;

    if (status == TrackableBehaviour.Status.TRACKED && statusInfo == TrackableBehaviour.StatusInfo.NORMAL)
    {
        // ...
    }
}

New method for retrieving Status and StatusInfo in Vuforia Engine 10.0:

public void ReadTargetStatus(ObserverBehaviour observerBehaviour)
{
    Status status = observerBehaviour.TargetStatus.Status;
    StatusInfo statusInfo = observerBehaviour.TargetStatus.StatusInfo;

    if (status == Status.TRACKED && statusInfo == StatusInfo.NORMAL)
    {
        // ...
    }
}

Furthermore, the DETECTED status has been deprecated. It was only returned for a single frame previously and did not provide any additional value over just returning TRACKED instead.

New World class

As in previous Vuforia Engine versions, the current tracking state is automatically applied to the Unity scene. Poses of known targets and anchors are automatically updated in the Unity scene, and events are fired if targets are found or lost.

The new World class serves as a central interface to query additional information about the current state or interact with the physical environment. It provides APIs to query Illumination data or do hit tests into the environment.

Vuforia Engine 9.8:

IlluminationManager illumMgr = TrackerManager.Instance.GetStateManager().GetIlluminationManager();
float intensity = (float)illumMgr.AmbientIntensity / 1000;

Vuforia Engine 10.0:

float intensity = (float) VuforiaBehaviour.Instance.World.IlluminationData.AmbientIntensity / 1000;

Detailed Migration Steps for Specific Features

Any functionality and Vuforia Engine feature configured in a Unity scene using the Unity Editor authoring workflow will continue to work without changes.

However, if your application uses the Vuforia Engine scripting API to control feature behavior, these scripts will likely need to be adapted.

In addition to the high-level changes outlined above, Vuforia Engine 10.0 API changes that are specific to individual features are listed below. Please keep in mind that most high-level changes apply to many of the features below, in particular the changes explained in Datasets and Tracker lifecycle no longer needs to be managed above.

Initialization Handling

In the Unity Extension, Vuforia Engine is initialized automatically. However, in case your application implemented custom initialization error handling or initialized Vuforia Engine explicitly with VuforiaRuntime.Instance have now been deprecated and replaced with new methods in VuforiaApplication.Instance. Additionally, some enum types have been simplified.

Vuforia Engine 9.8:

void Awake()
{
    VuforiaRuntime.Instance.RegisterVuforiaInitErrorCallback(OnVuforiaInitError);
}
void OnVuforiaInitError(VuforiaUnity.InitError error)
{
    if (error != VuforiaUnity.InitError.INIT_SUCCESS)
    {
        ShowErrorMessage(error);
    }
}

Vuforia Engine 10.0:

void Awake()
{
    VuforiaApplication.Instance.OnVuforiaInitialized += OnVuforiaInitError;
}

void OnVuforiaInitError(VuforiaInitError error)
{
    if (error != VuforiaInitError.NONE)
    {
        ShowErrorMessage(error);
    }
}

Device Tracking

Access to device tracking has been simplified and is now available centrally through VuforiaBehaviour.Instance.DevicePoseBehaviour.

Resetting Device Tracking

Vuforia Engine 9.8:

var deviceTracker = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>();
deviceTracker.Reset();

Vuforia Engine 10.0:

VuforiaBehaviour.Instance.DevicePoseBehaviour.Reset();

Registering to updates to the device tracking status 

Vuforia Engine 9.8:

private void Start()
{
    DeviceTrackerARController.Instance.RegisterDevicePoseStatusChangedCallback(OnDevicePoseStatusChanged);
}
void OnDevicePoseStatusChanged(Vuforia.TrackableBehaviour.Status status, Vuforia.TrackableBehaviour.StatusInfo statusInfo)
{
    Debug.Log("OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");

    …
}

Vuforia Engine 10.0:

private void Start()
{
    VuforiaBehaviour.Instance.DevicePoseBehaviour.OnTargetStatusChanged += OnDevicePoseStatusChanged; 
}
void OnDevicePoseStatusChanged(ObserverBehaviour behaviour, TargetStatus targetStatus)
{
    Debug.Log("OnDevicePoseStatusChanged(" + targetStatus.Status + ", " + targetStatus.StatusInfo + ")");
}

Enabling and disabling Device Tracking

Vuforia Engine 9.8:

public void ToggleDeviceTracking(bool enableDeviceTracking)
{
    var posDeviceTracker = TrackerManager.Instance.InitTracker<PositionalDeviceTracker>();
    if (enableDeviceTracking)
        posDeviceTracker.Start();
    else
        posDeviceTracker.Stop();
}

Vuforia Engine 10.0:

public void ToggleDeviceTracking(bool enableDeviceTracking)
{
    VuforiaBehaviour.Instance.DevicePoseBehaviour.enabled = enableDeviceTracking; 
    
}

Camera Access

Access to the Camera for setting focus, flash etc. has moved to VuforiaBehaviour.Instance.CameraDevice.

Vuforia Engine 9.8:

CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

Vuforia Engine 10.0:

VuforiaBehaviour.Instance.CameraDevice.SetFocusMode(FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

// Note: CameraDevice.Instance is still available, but deprecated. 
// It is still functional, but the enum needs to be adapted:
CameraDevice.Instance.SetFocusMode(FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

Image Targets

As with all other target types, explicit database management is no longer required for Image Targets. Image Targets, including Instant Image Targets, that were set up in a scene using the Unity Editor, will continue to work as before. The Observer will be created automatically as the scene is loaded.

Creating an Image Target at runtime from a texture has been significantly simplified.

Vuforia Engine 9.8:

ImageTargetBehaviour CreateImageTargetFromTexture(Texture2D texture, float widthInMeters, string targetName)

{
    var objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
    var runtimeImageSource = objectTracker.RuntimeImageSource;
    runtimeImageSource.SetImage(texture, widthInMeters, targetName);

    var dataset = objectTracker.CreateDataSet();
    var trackableBehaviour = dataset.CreateTrackable(runtimeImageSource, targetName);
    trackableBehaviour.gameObject.AddComponent<DefaultTrackableEventHandler>();
    
    objectTracker.ActivateDataSet(dataset);
    
    return  trackableBehaviour as ImageTargetBehaviour;
}

Vuforia Engine 10.0:

ImageTargetBehaviour CreateImageTargetFromTexture(Texture2D texture, float widthInMeters, string targetName)
{
    return VuforiaBehaviour.Instance.ObserverFactory.CreateImageTarget(texture, widthInMeters, targetName);
}

Similarly, loading and activating an Image Target from a device database is also much simpler in Vuforia Engine 10.0. See How to Create and Load Targets in Unity for details.

Vuforia Engine 9.8:

void LoadImageTarget(string dataSetPath, string imageTargetName, VuforiaUnity.StorageType storageType)
{
    ObjectTracker objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
    DataSet dataSet = objectTracker.CreateDataSet();
    dataSet.Load(dataSetPath, storageType);

    objectTracker.ActivateDataSet(dataSet);
}

Vuforia Engine 10.0:

void LoadImageTarget (string dataSetPath, string imageTargetName)
{
    VuforiaBehaviour.Instance.ObserverFactory.CreateModelTarget(dataSetPath, modelTargetName);
}

As with other targets, the ImageTargetBehaviour.ImageTarget member object has been removed. Its properties and method are now directly accessible through the ImageTargetBehaviour class.

Vuforia Engine 9.8:

Vector3 targetSize = imageTargetBehaviour.ImageTarget.GetSize();

Vuforia Engine 10.0:

Vector3 targetSize = imageTargetBehaviour.GetSize();

Model Targets

As with all other targets, managing datasets directly is no longer required for Model Targets. Targets that have been set up in the scene using the Unity Editor will continue to work just as in previous versions in Vuforia Engine.

To load and start observing a ModelTarget at runtime through scripting code, use the following method:

ModelTargetBehaviour modelTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateModelTarget("Vuforia/MyModelTargetDatabase.xml", "MySpecificModelTarget");

Furthermore, as with all other target types, the ModelTargetBehaviour.Trackable and ModelTargetBehaviour.ModelTarget member objects have been removed. All properties and methods previously exposed through these objects are now available directly from the ModelTargetBehaviour class.

Vuforia Engine 9.8:

public void SetModelTargetGuideView(ModelTargetBehaviour mtBehaviour, int guideViewIndex)
{
    string targetName = mtBehaviour.ModelTarget.Name;
    string guideViewName = mtBehaviour.ModelTarget.GetGuideView(guideViewIndex).Name;
    
    Debug.Log("Setting Guide View " + guideViewName + " for " + targetName);
    
    mtBehaviour.ModelTarget.SetActiveGuideViewIndex(guideViewIndex);
}

Vuforia Engine 10.0:

public void SetModelTargetGuideView(ModelTargetBehaviour mtBehaviour, int guideViewIndex)
{
    string targetName = mtBehaviour.TargetName;
    string guideViewName = mtBehaviour.GetGuideView(guideViewIndex).Name;

    Debug.Log("Setting Guide View " + guideViewName + " for " + targetName);

    mtBehaviour.SetActiveGuideViewIndex(guideViewIndex);
}

Area Targets

We recommend re-generating legacy Area Targets with the latest tools to match the Vuforia Engine version in use to avoid compatibility issues.

While Area Target set up in a Unity scene with the Editor will continue to work as before, the following method can be used to load and observe an Area Target at runtime:

AreaTargetBehaviour areaTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateAreaTarget("Vuforia/MyAreaTargetDatabase.xml", "MyAreaTarget");

As with other targets, the AreaTargetBehaviour.AreaTarget member object is no longer available. Methods like SetExternalPosition for setting the external prior continue to be available directly on the AreaTargetBehaviour class.

Cloud Recognition

Only minor adaptations need to be made in a Cloud Reco App.

The signatures of the various Cloud Reco callbacks have changed slightly. 
Only the type of the parameter needs to be updated as per this table.

Methods 9.8 Parameters 10,0 Parameters
CloudRecoBehaviour.RegisterOnInitErrorEventHandler TargetFinder.InitState CloudRecoBehaviour.InitError
CloudRecoBehaviour.RegisterOnUpdateErrorEventHandler TargetFinder.UpdateState CloudRecoBehaviour.QueryError
CloudRecoBehaviour.RegisterOnInitializedEventHandler TargetFinder CloudRecoBehaviour
CloudRecoBehaviour.RegisterOnNewSearchResultEventHandler TargetFinder.TargetSearchResult CloudRecoBehaviour.CloudRecoSearchResult

Example code change

Vuforia Engine 9.8:

public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
{
    mCloudContentManager.HandleTargetFinderResult(targetSearchResult);
}

Vuforia Engine 10.0:

public void OnNewSearchResult(CloudRecoBehaviour.CloudRecoSearchResult cloudRecoResult)
{
    mCloudContentManager.HandleTargetFinderResult(targetSearchResult);
}

Additionally, the various TargetFinder APIs have been moved to the CloudRecoBehaviour:

TargetFinder methods in 9.8 CloudRecoBehaviour methods in 10.0
TargetFinder.IsRequesting() CloudRecoBehaviour.Requesting
TargetFinder.ClearTrackables() CloudRecoBehaviour.ClearObservers()
TargetFinder.EnableTracking() CloudRecoBehaviour.EnableObservers()

For example, the following code needs to be adapted:

Vuforia Engine 9.8:

TrackerManager.Instance.GetTracker<ObjectTracker>().GetTargetFinder<ImageTargetFinder>().ClearTrackables(false);

Vuforia Engine 10.0:

mCloudRecoBehaviour.ClearTrackables(false);

Cylinder Targets

Cylinder Targets can be loaded and observed at runtime using this factory method:

CylinderTargetBehaviour cylinderTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateCylinderTarget("Vuforia/MyDataSet", "MyCylinderTarget");

All methods and properties previously available from CylinderTargetBehaviour.CylinderTarget are now directly available from CylinderTargetBehaviour.

Multi Targets

Multi Targets can be loaded and observed at runtime using this factory method:

MultiTargetBehaviour multiTarget = VuforiaBehaviour.Instance.ObserverFactory.CreateMultiTarget("Vuforia/MyDataSet", "MyMultiTarget");

All methods and properties previously available from MultiTargetBehaviour.MultiTarget are now directly available from MultiTargetBehaviour.

Ground Plane

GameObject functionality

Ground Plane experiences based on the Ground Plane and Mid Air game objects will continue to work without changes. This includes the following game objects provided by Vuforia Engine.

  • Plane Finder
  • Ground Plane Stage
  • Mid Air Positioner
  • Mid Air Stage

Any functionality based on these objects and components, including events attached to their events, does not need to be updated.

Ground Plane Runtime APIs

Some more advanced Ground Plane APIs have changed. Apps that were using not just the game objects above, but additional runtime scripting APIs might have to be adapted.

The Smart Terrain Tracker has been removed. It no longer needs to be managed manually. Consequently, checking for Ground Plane support at runtime has changed.

Vuforia Engine 9.8:

SmartTerrain smartTerrain = TrackerManager.Instance.GetTracker<SmartTerrain>();
if (smartTerrain == null)
    Debug.Log("SmartTerrain returned null. GroundPlane not supported on this device.");

Vuforia Engine 10.0:

if (VuforiaBehaviour.Instance.World.AnchorsSupported == false)
    Debug.Log("GroundPlane not supported on this device.");

Creating hit tests and Anchors without using the Ground Plane game objects can now be done with the following APIs.

Vuforia Engine 10.0:

AnchorBehaviour CreateAnchorFromHitTest(Vector2 imageSpacePos, float defaultHeight)
{
    AnchorBehaviour anchor = null; 
    HitTestResult hitTestResult;
    if (VuforiaBehaviour.Instance.World.HitTest(imageSpacePos, defaultHeight, out hitTestResult))
    {
        anchor = VuforiaBehaviour.Instance.ObserverFactory.CreateAnchorBehaviour("HitTestAnchor", hitTestResult);
    }

    return anchor;
}

AnchorBehaviour CreateAnchorAtPosition(Vector3 position, Quaternion rotation)
{
    return VuforiaBehaviour.Instance.ObserverFactory.CreateAnchorBehaviour("MidAirAnchor", position, rotation);
}

Resetting Anchors

Before resetting device tracking, any previously set AnchorBehaviours need to be Unconfigured in order to reuse them afterwards.

Vuforia Engine 10.0:

public void ResetDevicePoseBehaviour()
{
    mPlacementAnchor.UnconfigureAnchor();
    mPlaneAnchor.UnconfigureAnchor();
    mMidAirAnchor.UnconfigureAnchor();

    VuforiaBehaviour.Instance.DevicePoseBehaviour.Reset();
}

Extension Methods

Previous Vuforia Engine versions included a GameObject Extension method called GameObject.PositionAt that was used in some Ground Plant sample code. This was removed with Vuforia Engine 10.0.

Vuforia Engine 9.8:

chair.PositionAt(cameraToPlaneHit.point);

Vuforia Engine 10.0:

chair.transform.position = cameraToPlaneHit.point;

Object Targets

Object Targets can be loaded and observed at runtime using this factory method:

ObjectTargetBehaviour objectTarget =
    VuforiaBehaviour.Instance.ObserverFactory.CreateObjectTargetBehaviour("Vuforia/MyDataSet", "MyObjectTarget");

All methods and properties previously available from ObjectTargetBehaviour.ObjectTarget are now directly available from ObjectTargetBehaviour.

VuMarks

VuMarks can be loaded and observed at runtime using this factory method:

VuMarkBehaviour vuMark = VuforiaBehaviour.Instance.ObserverFactory.CreateVuMarkBehaviour("", "");

As with other targets, the VuMarkBehaviour.VuMarkTarget member object has been removed, all its properties and methods are now directly available from VuMarkBehaviour.

Vuforia Engine 9.8:

string GetVuMarkId(VuMarkBehaviour vumarkBehaviour)
{
    switch (vumarkBehaviour.VuMarkTarget.InstanceId.DataType)
    {
        case InstanceIdType.BYTES:
            return vumarkBehaviour.VuMarkTarget.InstanceId.HexStringValue;
        case InstanceIdType.STRING:
            return vumarkBehaviour.VuMarkTarget.InstanceId.StringValue;
        case InstanceIdType.NUMERIC:
            return vumarkBehaviour.VuMarkTarget.InstanceId.NumericValue.ToString();
    }
    return string.Empty;
}

Vuforia Engine 10.0:

string GetVuMarkId(VuMarkBehaviour vumarkTarget)
{
    switch (vumarkTarget.InstanceId.DataType)
    {
        case InstanceIdType.BYTES:
            return vumarkTarget.InstanceId.HexStringValue;
        case InstanceIdType.STRING:
            return vumarkTarget.InstanceId.StringValue;
        case InstanceIdType.NUMERIC:
            return vumarkTarget.InstanceId.NumericValue.ToString();
    }
    return string.Empty;
}

The VuMarkManager class has been marked deprecated. The events exposed through that class in previous Vuforia Engine versions are now available in VuforiaBehaviour.Instance.World. As part of this change, VuMarkManager.RegisterVuMarkBehaviourDetectedCallback and VuMarkManager.RegisterVuMarkDetectedCallback have been combined into a single event: VuforiaBehaviour.Instance.World.OnObserverCreated.

Vuforia Engine 9.8:

TrackerManager.Instance.GetStateManager().GetVuMarkManager().RegisterVuMarkBehaviourDetectedCallback(OnVuMarkBehaviourDetected);

public void OnVuMarkBehaviourDetected(VuMarkBehaviour vumarkBehaviour)
{
    …
}

Vuforia Engine 10.0:

VuforiaBehaviour.Instance.World.OnObserverCreated += OnVuMarkBehaviourDetected;

public void OnVuMarkBehaviourDetected(ObserverBehaviour observerBehaviour)
{
    if (observerBehaviour is VuMarkBehaviour)
    {
        ...
    }
}

Lifecycle changes

In addition to the API changes outlined above, there is also a change in how multiple VuMark instances will be returned in Unity.

In previous Vuforia Engine versions, for every newly detected VuMark instance, a copy of the VuMarkBehaviour GameObject was instantiated. If the VuMark was lost, that instance went into a pool of game objects that would be reused if a new VuMark instance got detected – even if it was another instance.

This has changed with Vuforia Engine 10.0. Previously lost VuMarkBehaviour instances will not be recycled and associated with different VuMark instances. Instead, they will only be reused if the same VuMark instance (ID) is detected again.

For apps that detect a large number of VuMarks, we recommend deleting VuMarkBehaviours of instances that have been lost after some time.

Illumination Data

Access to the Illumination data previously provided through the TrackerManager’s IlluminationManager has changed. It is now available through VuforiaBehaviour.Instance.World.IlluminationData.

Vuforia Engine 9.8:

IlluminationManager illumMgr = TrackerManager.Instance.GetStateManager().GetIlluminationManager();
float intensity = (float)illumMgr.AmbientIntensity / 1000;

Vuforia Engine 10.0:

float intensity = (float) VuforiaBehaviour.Instance.World.IlluminationData.AmbientIntensity / 1000;

Recommended FPS

Access to the recommended FPS setting has changed. See the Device Performance Optimization article for details.

Vuforia Engine 9.8:

int targetFps = VuforiaRenderer.Instance.GetRecommendedFps(VuforiaRenderer.FpsHint.NONE);

Vuforia Engine 10.0:

int targetFps = VuforiaBehaviour.Instance.CameraDevice.GetRecommendedFPS();

Virtual Buttons

Virtual Buttons set up in a Unity scene will continue to work as before, including all event handling code that uses VirtualButtonBehaviour.RegisterOnButtonPressed or VirtualButtonBehaviour.RegisterOnButtonReleased.

As in previous versions of Vuforia Engine, Virtual Buttons can be created at runtime using ImageTargetBehaviour.CreateVirtualButton.

The redundant VirtualButtonBehaviour.VirtualButton object has been removed, all methods and properties are available from the VirtualButtonBehaviour class directly.

Camera Pose

CentralAnchorPoint was available in previous Vuforia Engine versions to get access to the current pose of the ARCamera in the Unity scene. This accessor has been removed in Vuforia Engine 10.0. Instead, use the transform of VuforiaBehaviour.

Vuforia Engine 9.8:

public Transform GetARCameraTransform()
{
    return VuforiaManager.Instance.CentralAnchorPoint;
}

Vuforia Engine 10.0:

public Transform GetARCameraTransform()
{
    return VuforiaBehaviour.Instance.transform;
}

Back to top

Can this page be better?
Share your feedback via our issue tracker