Skip to content

Vuforia Play Mode in Unity

Vuforia Play Mode is fully integrated in Unity and it is the quickest way to test your projects during development right at your PC or Mac. Use the Webcam, Simulator or Recording Play Mode that is distributed with the Vuforia Engine SDK for Unity to fast-track your development process.

Unity's Play Mode supports all target types from Vuforia, and it is controlled by using Unity's Play, Pause, and Stop buttons. Each Play Mode enables you to quickly test your build and your targets with augmentations.

Vuforia Play Modes

  • Webcam
  • Simulator
  • Recording

The three modes can be found in the Vuforia Configuration from a dropdown menu. To enable Vuforia Engine in Unity, please refer to this guide.

Play Mode Video Tutorial

Webcam Play Mode

The Webcam Play Mode uses a webcam to simulate tracking of Vuforia targets at your desk. It requires you to use your in-built Webcam in your laptop or connect one via USB (External Camera) to your PC. The Vuforia Engine will automatically detect if a Webcam is available that can be chosen from the dropdown menu Camera Device if you have multiple connected.

Testing Targets Types with WEBCAM

Webcam play mode supports all Vuforia target types except Area Targets which is supported only in Simulator Mode. Once in play mode, the webcam will simulate detection and tracking of your target. Test your target and your content as you would if you had built the Unity Project to your device.

Note that Device Tracking is not as good on a webcam as it would be on your device given that your webcam does not come with any sensors.

Vuforia Ground Plane emulation

To test Vuforia Ground Plane with a Webcam, it is necessary to use an Image Target as the ground. A webcam cannot detect and track the ground on its own, so we will instead emulate the ground with an Image Target. If you are using the Vuforia Core Samples, the EmulatorGroundPlane.pdf can be found in  Packages\VuforiaEngineAR\Vuforia\Databases\ForPrint\Emulator or in Packages\com.ptc.vuforia.engine\Vuforia\Database\ForPrint\Emulator

For more information, please refer to Introduction to Ground Plane in Unity.

Simulator Play Mode

This Play Mode purely simulates tracking and detection of your Vuforia targets. When enabled, the simulator mode creates a virtual space in which you can move the ARCamera around. Area Targets work well in this play mode, as you can navigate around the space as a user would and preview your content and interactive components.

You can use other target types independently or together in the simulator mode if you, for instance, do not have your target nearby or it is too large to test with a webcam.

Note

Creating Vuforia targets at runtime is not supported in simulator mode.

Note

Step Check is not supported in simulator mode.

Go to Vuforia Configuration and set the Play mode type to SIMULATOR. For the ARCamera movement, you can adjust the virtual walking speed, turning speed, and detection distance.

The simulator mode uses a Simulator Actions Input Asset to bind the keys for moving. Edit this asset to customize your key bindings, or add your input scheme with bindings for:

  • Move (Vector3)
  • Look (Vector2)
  • Sprint (Button)

Vuforia Default Input Action Asset for Simulator Play Mode

Testing Target Types with SIMULATOR

To test one or more of your Vuforia Targets in your build, simply add the Vuforia Engine GameObjects to your scene and set them up with the appropriate targets or databases. Upon pressing Play, you can navigate within the space starting at the origin of the ARCamera GameObject.

Target detection in simulation mode

Simulator mode is helpful for positioning and testing your content in relation to scanned areas and other target types.

Vuforia Engine reports targets as tracked as soon as they come into the virtual camera view and closer than the detection distance defined in the Vuforia Configuration.

If the Track Device Pose is enabled, Vuforia Engine reports the targets as extended tracked as soon as they leave the camera view.

Simulator mode allows you to rapidly prototype your application's scripts and test how your logic handles when your targets are detected or out of view, even if you do not have the physical targets nearby.

NOTE: This simulated detection does not use computer vision and, therefore, does not replace testing your real targets' actual detection and tracking quality on mobile devices.

Recording Play Mode

Unity's Editor Play Mode can also be used with video recordings from the Session Recorder API. It is a convenient addition to help you continuing authoring with your Vuforia Targets even when the target is not available or in vicinity to you. Using a recording in Play Mode requires a video recording made with the Session Recorder API. See Recordings and Playback for more information on creating recordings.

Set up a Vuforia enabled scene with the ARCamera GameObject, and a Vuforia target that was captured in the recording you previously created. 

  1. In the Vuforia Configuration, set the Play Mode type to -- RECORDING. 
  2. Browse to the directory of your recording(s) and select one of the files.
  3. Change or add content to your Vuforia target and press Play. This will play back the video recording of your Vuforia target and present content according to your scene build.

The work can then continue with exchanging content on the Vuforia target and test it in the recorded sessions and scenarios. We encourage you to integrate this feature into your development process and use recordings to adjust your AR app to specific scenarios, environments, Vuforia targets, and even lighting settings, and use the versatile possibilities that a recording can offer. 

Learn More

Getting Started with Vuforia in Unity

Introduction to Model Targets in Unity

Working with VuMarks

Introduction to Ground Plane in Unity

Using Area Targets in Unity

Recordings and Playback