Skip to main content

Creating Your First Survey

This quick start guide walks you through creating a basic survey scene in Unity. By the end of this guide, you'll have a fully functional survey ready for deployment in your study.

Here's what the finished survey will look like:

The finished survey

1. Create the Survey Scene​

First, create a Survey Scene. Use the Survey Page scene template, which provides a ready-made setup with all the necessary components for running a survey.

Image of Survey Scene opened in Editor

1
Open New Scene Dialog

In Unity's main menu, select File > New Scene (or press Ctrl + N).

Image/gif of File > New Scene

2
Select the Survey Page template

In the New Scene Dialog, select the Survey Page template.

Image of New Scene Dialog with Survey Template Selected

3
Verify the scene opened

An Untitled Survey scene opens in the Editor.

Image of Untitled Survey Scene opened in Editor

4
Save the scene

Save the scene immediately (Ctrl + S), choose a location, and give it a meaningful name (for example, MyDrivingExperienceSurvey).

Image of saved Scene in project window

You should now have a Survey Scene ready, with a sample Survey Page already set up.

2. Create Survey Page Data​

Next, create a Survey Page Data ScriptableObject to hold the content of the Driving Experience Survey page.

1
Create the Survey Page Data asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Pages. Name it DrivingExperiencePage.

Image/gif of Survey Page Data create menu

2
Set the Items list size

In the Inspector, set the page data's Items list size to 4.

Image of Items list with size of 4

3
Select the SurveyUIDocument GameObject

In the Hierarchy, select the SurveyUIDocument GameObject.

4
Assign the ScriptableObject to the Survey Page Generator

Drag the ScriptableObject you just created from the Project window into the Survey Page Data field of the Survey Page Generator component in the Inspector.

Survey Page Data set in Survey Page Generator

You now have a page container ready to hold all survey items for your survey. With the page set up, you can move on to creating the individual survey items.

3. Create Survey Items: Header and Subheader​

1
Create the first Survey Contents asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Contents.

Image/gif of Survey Items Data create menu

2
Name the first item

Name the first item DrivingSurvey_Header.

3
Set the Type to Header

In the Inspector, set the Type field to Header.

4
Enter the header text

Type Driving Experience Survey into the Text field.

Image of configured DrivingSurvey_Header

5
Create the second Survey Contents asset

In the Project Window, right-click again and select Create > ScriptableObject > Assessments > Survey > Contents.

6
Name the second item

Name the second item DrivingSurvey_Subheader.

7
Set the Type to Sub Header

In the Inspector, set the Type field to Sub Header.

8
Enter the subheader text

Type Please answer the following questions about your driving experiences. into the Text field.

Image of configured DrivingSurvey_Subheader

9
Select the DrivingExperiencePage asset

Select the DrivingExperiencePage ScriptableObject in the Project Window.

10
Assign the header and subheader to the Items list

In the Inspector, assign DrivingSurvey_Header to Element 0 and DrivingSurvey_Subheader to Element 1 of the Items list.

DrivingExperiencePage's current state

The page now includes the header and subheader, ready for adding the first question.

The survey page's current progress (with only header and subheader)

4. Create Survey Items: First Question​

1
Create the first question asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Contents to create a Survey Item. Name it DrivingSurvey_Q1.

2
Set the Type to Questions

In the Inspector, set the Type field to Questions.

3
Enter the question text

Type How confident do you feel when driving in heavy traffic? into the Text field.

4
Enable Required to Answer

Enable Required to Answer.

Image of configured DrivingSurvey_Q1

5
Assign the question to Element 2

In DrivingExperiencePage's Inspector, drag DrivingSurvey_Q1 to Element 2 of the Items list.

DrivingExperiencePage's items current state (with DrivingSurvey_Q1)

6
Create the Input Option asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Input Option to create a Survey Input. Name it DrivingSurvey_Q1_Inputs.

Image/gif of Survey Input Option create menu

7
Configure the Options list with 9 elements

With DrivingSurvey_Q1_Inputs selected, set the Options list size to 9 and configure each element as follows:

  • Element 0 — Type: Label; Label: Not confident
  • Element 1 — Type: Radio; Label: 1
  • Element 2 — Type: Radio; Label: 2
  • Element 3 — Type: Radio; Label: 3
  • Element 4 — Type: Radio; Label: 4
  • Element 5 — Type: Radio; Label: 5
  • Element 6 — Type: Radio; Label: 6
  • Element 7 — Type: Radio; Label: 7
  • Element 8 — Type: Label; Label: Very confident

Image of configured DrivingSurvey_Q1_Inputs

8
Assign the Inputs asset to the question

Select DrivingSurvey_Q1 and drag DrivingSurvey_Q1_Inputs to the Options Data field in the Inspector.

Image of DrivingSurvey_Q1's Option Data field

At this point, you've completed the first question of the Driving Experience Survey. The page now includes a header, subheader, and your first question with a 7-point confidence scale.

The survey page's current progress (with header, subheader, Q1)

Next, you'll create the second and final survey question.

5. Create Survey Items: Second Question​

1
Create the second question asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Contents to create a Survey Item. Name it DrivingSurvey_Q2.

2
Set the Type to Questions

In the Inspector, set the Type field to Questions.

3
Enter the question text

Type How stressful do you usually find long-distance driving? into the Text field.

Image of configured DrivingSurvey_Q2

4
Assign the question to Element 3

In DrivingExperiencePage's Inspector, drag DrivingSurvey_Q2 to Element 3 of the Items list.

DrivingExperiencePage's items current state (with DrivingSurvey_Q2)

5
Create the second Input Option asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Input Option to create a Survey Input. Name it DrivingSurvey_Q2_Inputs.

6
Set Element 0 to Slider type

With DrivingSurvey_Q2_Inputs selected, set the Options list size to 1 and set Element 0's Type to Slider.

Image of configured DrivingSurvey_Q2_Inputs

7
Create the Slider configuration asset

In the Project Window, right-click and select Create > ScriptableObject > Assessments > Survey > Input Configurations > Slider to create a slider configuration. Name it DrivingSurvey_Q2_Inputs_Slider.

Image/gif of Slider config create menu

8
Configure the Slider asset

Configure DrivingSurvey_Q2_Inputs_Slider in the Inspector as follows:

  • Min: 0
  • Max: 100
  • Step: 25
  • Initial Value: 50
  • Under Tick Marks, set the size to 5 and configure each element as follows:
    • Element 0: Value = 0, Label = Not Stressful
    • Element 1: Value = 25
    • Element 2: Value = 50
    • Element 3: Value = 75
    • Element 4: Value = 100, Label = Very Stressful

Image of configured DrivingSurvey_Q2_Inputs_Slider

9
Select the Q2 Inputs asset

In the Project Window, select DrivingSurvey_Q2_Inputs.

10
Assign the Slider configuration to the Options list

In the Inspector, expand Element 0 of the Options list and drag DrivingSurvey_Q2_Inputs_Slider into the Slider Option Data field.

Image of fully configured DrivingSurvey_Q2_Inputs

11
Assign the Inputs asset to the question

Select DrivingSurvey_Q2 and drag DrivingSurvey_Q2_Inputs to the Options Data field in the Inspector.

At this point, you've completed a fully functional Driving Experience Survey.

The finished survey

To expand the survey, try adding more questions on your own, such as a question with a text area, a question with a dropdown input, or other input types to collect different kinds of responses.