NOTE: CognitiveVR has been rebranded to Cognitive3D. Code references, methods, menus, and variables remain untouched.

Using ExitPoll


ExitPoll allows you to directly ask questions to your users. This only requires a line of code and and some options on your Cognitive3D dashboard. This page will walk you through the process of enabling and configuring an ExitPoll in your application.

This page explains how to implement Exit Poll in version 0.6.3 and later


Prefab Overview

The ExitPoll prefab should be ready to use in any application. It was built to be flexible and easy to change to fit your art and functionality.


  • The ExitPoll panel uses Unity's built in Canvas system
  • All the art is separated from the functioning part of this panel, so replacing this with your assets should be easy
  • Buttons are interacted with by the user's gaze, so no assumptions are made about your input methods


  • The buttons have a small radius that fills while the user is looking at it
  • It uses a dot product check to determine the user's gaze
  • The On Look action is similar to Unity's Canvas buttons - they can invoke functions on other components. These are loosely connected so you can replace these buttons with your own button script with minimum effort

Scale Panel

The ExitPollScale Panel includes a gradient property. This only has an effect on the Scale Panel. When the Scale Panel is created, it applies colours from this gradient based on the number of options the scale displays.

gradient settings


Creating an Exit Poll

Exit Poll Hooks and Question Sets are created on the Cognitive3D Dashboard. A Hook is requested from the application during the experience and receive a Question Set as a response. This has two advantages:

  • You can change which Question Set to display from a Hook without updating your application.
  • You can reuse Question Sets over multiple Hooks.

The example here will display a Question Set about performance at the end of the level.

In the ExitPoll section of the dashboard, press Create New Hook, then fill in the fields.

new hook

Click on the Question Sets Header. Press the New Question Set button. Each question will be displayed as a panel one at a time. Use the handle on the right side of the question to change its order in the Question Set. Make sure to save!

question set

Both the Hook and the Question Set have been created, but the Hook has not been assigned a Question Set to display.

inactive question set

Click on the Hooks Header. You can select the Question Set and version that a Hook should respond with. Make sure to hit apply!

apply question set

The Question Set Header will allow you to save modified Question Sets as different versions. Results will show a comprehensive analysis of your Exit Poll responses in the context of your user's experience. This may take up to 3 hours to display.

apply question set

Displaying an Exit Poll

An Exit Poll can be displayed with this code:

public string HookName = "level_complete";

void Start()

Only one exit poll can be active at a time.

When creating an Exit Poll, you may include many other methods to modify how the panels will display. Here is a complete list of methods:

public string HookName = "level_complete";

private void Start ()
    //an action to display a debug message
    System.Action debugCloseAction = () => Debug.Log("ExitPoll closed");

        .NewExitPoll(HookName)                            //closes any existing exit poll and displays a new question set using the HookName
        .SetEndAction(OnEndExitPoll)                        //sets an action to happen when the exit poll is completed
        .AddEndAction(debugCloseAction)                   //adds another action to perform when the exitpoll is completed
        .SetPanelLayerMask("Default", "World", "Ground")    //sets layers the Exit Poll Panel will avoid spawning in
        .SetDisplayDistance(3, 1)                         //set the prefered distance from the player to display the Exit Poll
                                                            //Can go down to the minimum distance to avoid collisions with layermask set above
        .SetDisplayReticle(true)                          //creates a small reticle to display where the user is gazing while the exit poll is active
        .SetLockYPosition(true)                             //display the exit poll at the same y height as the HMD
        .SetRotateToStayOnScreen(true)                    //move the Exit Poll Panel to stay in front of the player
        .SetStickyWindow(true)                              //move the Exit Poll Panel if the user moves, such as teleporting
                                                          //This should not be used if the main camera does not have a root gameobject!
        .SetTimeout(true, 15)                               //sets a time limit that will skip the question if the user does not answer

private void OnEndExitPoll()
    //some code

If you need to close the ExitPoll manually, you can use this code:

private void ManuallyCloseExitPoll()

EndAction is invoked when the question and microphone are answered.

EndAction will be called immediately if there is some issue with displaying the questions, such as the spawn point of the ExitPoll prefab is too close to the HMD position or the requested HookName is invalid.