Skip to content

Troubleshooting

General Debugging

Click cognitive3D->Advanced Options to select the CognitiveVR Prefernces. The Enable Logging checkbox will log more information from cognitiveVR components. This should be disabled in a release build.

Selecting your SDK

In the Scene Setup window, you can select an SDK for a VR plugin you are using. This will set a scripting define symbol to enable code. If you do not have the SDK in your project or it is not the correct version, you may have compile errors. To manually clear the SDK settings, you can use Edit->Project Settings->Player. In Other Settings, clear any symbols that begin with CVR_.

scripting define symbols

Fixation Recorder

If you are using eye tracking hardware for your project, you can record fixations to give you a detailed look at how your users are focusing throughout your experience.

First, make sure you select the correct SDK from the Scene Setup window. Then, attach a Fixation Recorder component to the CognitiveVR_Manager game object in your scene. There are several parameters on the component to configure how fixation points are recorded. The default values are taken from several academic papers and should be suitable for most projects.

Fixations are only supported with the Physics Gaze Type, configurable in the cognitive3D->Advanced Options menu.

SceneExplorer

Some meshes are not exported

  • We do not currently support exporting Line Renderers, Trail Renderers, Particles or procedural meshes that do not reference saved asset files. Some materials (such as transparent materials) may have issues rendering correctly on SceneExplorer.

Meshes that are a child of a Dynamic Object will be exported with that Dynamic Object and NOT exported with the scene.

Additive Scene Loading

Scene Id

  • When using multiple scenes, we find most developers use a 'functional' scene and an 'art' scene. You only need to upload your 'art' scene using the Scene Setup window. After this scene is uploaded, you can remove the CognitiveVR_Manager gameobject from that scene hierarchy.

Open your 'functional' scene, then step through the Scene Setup window again. However, you only need to complete the first few steps, up to and including configuring your controllers. You do not need to export any Dynamic Objects or upload this scene. This scene should have a CognitiveVR_Manager gameobject in the hierarchy.

When the 'art' scene is loaded during the experience, the CognitiveVR_Manager should automatically set the correct scene id.

Player Position and Gaze Tracking

Main Camera

  • It is expected that the player's hmd will use a camera tagged MainCamera. This is used as a fallback when a camera cannot be found in SteamVR [CameraRig] or Oculus OVRCameraRig. If there are multiple *MainCamera*s in the scene, there may be unexpected results in your session data.

No data uploaded to Scene Explorer

There are a few common reasons data from your play session might not display on SceneExplorer

No CognitiveVR_Manager

Make sure there is a CognitiveVR_Manager in your scene.

The scene does not have a Scene Key associated with it

The Scene Key is the ID used by SceneExplorer to send data to the correct scene. Without a scene key, data is not collected and not uploaded. This is automatically set when you export your scene. See Exporting Scene. You can also see your Scene Settings from the cognitive3D->Advanced Options menu.

Application is closed unexpectedly

Unity's implementation of OnQuit does not work as expected when the process is ended without calling Application.Quit. This also doesn't work as expected on mobile. Reliable ways of sending data to SceneExplorer are:

  • Enable Send Data on Level Load in Tracker Options Window
  • Call CognitiveVR.Core.SendDataEvent(); will send player data to SceneExplorer

Gaze points aren't visible on SceneExplorer

Debug view on SceneExplorer

Enable debug view on SceneExplorer. At the end of the URL for your scene, add ?debug to view gaze points as though they were events.

Gaze points aren't appearing on Dynamic Objects

  • Make sure your Dynamic Objects have a collider and that the collider is not set as 'trigger'. You should also try to get your collider's size to be as close as possible to the surface of your mesh.

Additional Requirements for your HMD

If you are using the Fove or Pupil Labs headsets, there are additional steps you may need to take before collecting data. See this page for details.

Command Buffer Gaze and Custom Shaders

There are occasionally some issues with custom shaders when using the Command Buffer method to record gaze. One example is with the Valve Lab Renderer. If you are using these shaders, you should add Fallback "Standard" after the SubShader.

Shader "Valve/vr_standard"
{
    Properties
    {
        //properties are here
    }
    SubShader
    {
        Pass
        {
            //forward + lighting
        }
        Pass
        {
            //meta pass
        }
    }

    Fallback "Standard" //Add this here!
    CustomEditor "ValveShaderGUI"
}

Controller Inputs

SteamVR 2.2.0

Controller Input Tracking is supported for the Vive Controller using SteamVR 2.2.0 and CognitiveVR Unity package v0.11.3 or later.

Before running the Cognitive Scene Setup Wizard, you must have opened the SteamVR Input Window and pressed Save and generate. After pressing Setup Controller Dynamics, Append Cognitive Action Set and Add Default Bindings.

Finally, you must open the SteamVR Input Window again and press Save and generate.

Manual Setup

The Dynamic Object component can track the player's controllers:

  1. Add a Dynamic Object component to the left and right controller GameObjects.
  2. Uncheck 'UseCustomMesh'.
  3. Choose the controller type from the dropdown menu.
  4. Check 'IsController' in Advanced Options.
  5. Choose the controller input display type from the dropdown menu.
  6. Check or uncheck 'IsRight' if this controller is the right hand controller.

  • For SteamVR v1.2, each controller must also have a Controller Input Tracker component.

  • For Oculus, the Controller Input Tracker should be on a separate gameobject and have Left Hand and Right Hand fields reference the Dynamic Object components on each controller.

Exit Poll

Exitpoll panel never appears

Not spawning from code

This code will log when the ExitPoll Panel is created and the ExitPoll is closed. There may be other issues, but this sanity check can be helpful

    IEnumerator Start()
    {
        yield return new WaitForSeconds(6);
        Debug.Log("Initialize ExitPoll");

        System.Action action = () => Debug.Log("ExitPoll Closed");
        CognitiveVR.ExitPollPanel.Initialize(action);
    }

Collision

Collision is off by default, but make sure the LayerMask is correctly configured when the ExitPoll is spawned. If you are using the Oculus Utilities OVRPlayerCharacter prefab, it could be colliding with the CharacterController collider. It may also be colliding with the player's hands or held items.

Local Data Cache

Where are is the cache located?

The local data cache is in the c3dlocal folder in Application.PersistentDataPath. This is different for each platform. This has been tested on Windows 10 and Android.

When is data read from the cache?

The data from the cache is read and removed when you have an internet connection and while running the application. A cvr-request-time response header is checked to determine if the device is connected to the internet and not blocked by a capture portal (for example, a login page on hotel wifi).

Manually sending data from Local Data Cache

You can manually send data from the cache using the following code:

CognitiveVR.NetworkManager.UploadAllLocalData(() => Debug.Log("complete"), () => Debug.Log("failed"));

This will quickly try to upload all outstanding requests and invoke the callbacks when it is completed. This will fail if the device is offline or if Local Storage is disabled.

Unity Scriptable Render Pipelines

Since the Scriptable Render Pipeline is meant to be customized, the instructions below might be slightly different for your project. Please get in touch if you have trouble implementing the Cognitive SDK into Unity.

Lightweight VR Pipeline 3.0.0

Recording gaze with the Physics Gaze Type works as expected.

Recording gaze with the Command Gaze Type requires these changes:

  • Add SRP_LW3_0_0 in your scripting define symbols.
  • Replace line 142 in the LightweightPipeline script with this. Notice the extra parameter at the end of this function. m_Renderer.Execute(ref context, ref m_CullResults, ref renderingData, camera.GetCommandBuffers(CameraEvent.BeforeForwardOpaque));
  • Replace the Execute function in LightweightForwardRenderer script at line 117 with this.
    public void Execute(ref ScriptableRenderContext context, ref CullResults cullResults, ref RenderingData renderingData, UnityEngine.Rendering.CommandBuffer[] buffers)
    {
        for (int i = 0; i < m_ActiveRenderPassQueue.Count; ++i)
        {
            //execute command buffers just before CreateLightweightRenderTexturePass is executed
            if (i == 2) { foreach (var buf in buffers) { context.ExecuteCommandBuffer(buf); } }
            m_ActiveRenderPassQueue[i].Execute(ref context, ref cullResults, ref renderingData);
        }
    
        DisposePasses(ref context);
    }
    

HD Pipeline

Recording gaze with the Physics Gaze Type works as expected.

Recording gaze with the Command Gaze Type is not supported at this time.