Skip to content

Troubleshooting

General Debugging

Click cognitive3D->Advanced Options to select the Cognitive3D Prefernces. The Enable Logging checkbox will log more information from Cognitive3D 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 participants 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 GameObject 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.

Some lights are not exported

Area lights are not supported and will be skipped when exporting your scene. Many advanced properties from HDRP and URP lights may not be supported either.

I am getting an error when trying to upload my Scene or Dynamic Objects.

There are a few commons reasons for errors during the upload process:

Do you have both of the Application Key and Developer Key set properly? We do not store the Developer Key in Unity or Unreal project folders for security purposes, and this key may be lost when moving PCs or changing engine versions. You can simply get the Developer Key again from the Dashboard.

In the Advanced Options panel, do you have "Custom Gateway" set to "data.cognitive3d.com" ?

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 SceneExplorer

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. 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 session data to the Dashboard

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.

controller select

  • 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.

ExitPoll

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.

Custom Shaders

If you find a surface in SceneExplorer is white, it is likely the surface in Unity is using a material with an unsupported shader.

When using shader graphs or different render pipelines, materials may use different property names to identify textures and values. We automatically support many shaders that are included with Unity, but you may need to add support for your custom shaders.

First, create a new script in the CognitiveVR/Editor/GLTF folder and name it something to represent the custom shader you wish to support.

shader property class

In Unity, select one of the surfaces that appears white on SceneExplorer. In the top right of the Inspector select the Debug option from the dropdown menu. Notice the material properties at the bottom of the inspector. These values will be used in the script to identify which textures should be exported.

shader properties

Open the script you created earlier. In the constructor you can set names of material properties. In some cases, you may need to override methods and perform additional logic on these values. Below is an example for a simple custom shader. The GLTF exporter will automatically select the correct ShaderPropertyCollection based on the ShaderNames.

using UnityEngine;

public class MyCustomShaderProperties : UnityGLTF.GLTFSceneExporter.ShaderPropertyCollection
{
    public MyCustomShaderProperties()
    {
        ShaderNames.Add("Custom/My Custom Shader"); //this should match the 'shader name' and not the filename of the shader
        AlbedoMapName = "_AlbedoMap"; //often uses the words: albedo, diffuse, base
        AlbedoColorName = "_Color";
        MetallicPowerName = "_Metalic"; //note the typo. this is how it is written in the shader, and should match exactly
        RoughnessPowerName = "_Smoothness"; //often roughness, shininess, gloss, smoothness
    }

    //gltf uses roughness. in this case, we can override this method and do some logic
    //roughness = 1 - shininess
    public override bool TryGetRoughness(Material m, out float power)
    {
        power = 1 - m.GetFloat("_Smoothness");
        return true;
    }
}

Unity ProBuilder Meshes

When using Unity's ProBuilder tool, you must use ProBuilder's Export Settings to save your mesh as a Prefab or an Asset. Otherwise, this geometry will be skipped when exporting your Scene or Dynamic Object.

probuilder export settings