# How to unlock a level using a textbox question (with one correct answer)?

I'm currently working on a 3D Unity game that has 3 levels, but each level has to be unlocked by answering a question to walk through the door leading to the next level. I have a next level trigger collider to move from level to level, but I'm not sure how to create the level trigger for the input field's (correct) element.

Example: What color is the floor? Correct Answer: Blue

Here is the code for the collider/door:

    using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

{

public GameObject enterText;

void Start()
{
enterText.SetActive(false);
}

// Update is called once per frame
void OnTriggerStay(Collider player)
{
if (player.gameObject.tag == "Player")
{
enterText.SetActive(true);
if (Input.GetButtonDown("Use"))
{
}
}
}
void OnTriggerExit(Collider player)
{
if (player.gameObject.tag == "Player")
{
enterText.SetActive(false);
}
}
}

• How much do you already know about the Unity UI system? Would we need to explain it to you from the very beginning how a canvas works? Do you just need to know how to read the value from an InputField component? Or can you already do that and you wonder how to communicate it back to the script you posted here? Dec 31 '21 at 17:10
• @Philipp I can make the UI Canvas and I'm working on the inputField component, but I'm mainly lost on how to make the InputField relate to unlocking the door level trigger. Dec 31 '21 at 17:38