It turns out the culprit is a script in your project called MouseLook.cs
This script locks the cursor and deactivates it. When you first start the game, it looks like you have a cursor, but that is just because the game hasn’t “captured” it yet, which doesn’t happen until you click in side the Game Window. At that point, even though I cliced on Next, nothing happened because the Cursor state had already been locked and hidden. As soon as I commented out the code to lock the cursor, I could click on and interact with the dialogue…
Of course, this isn’t the intended behaviour in a 1st person game, you generally want the cursor hidden. What you can do instead is assign hot keys that each button could respond to…
What I would do is add a script to the buttons that trigger them when certain keys are pressed, for example:
using System;
using UnityEngine;
using UnityEngine.UI;
public class ButtonProxy : MonoBehaviour
{
private Button button;
private KeyCode key;
private void Awake()
{
button = GetComponent<Button>();
}
public void SetKey(KeyCode keyCode)
{
key = keyCode;
}
private void Update()
{
if (key < 0) return;
if (Input.GetKeyDown(key))
{
button.onClick?.Invoke();
}
}
}
With this script on the same script as the buttons, you can use the SetKey() method to set a key to invoke the button. For example, Next might be SetKey(KeyCode.Return), and Quit might be SetKey(KeyCode.Escape); Your choices might be SetKey(KeyCode.Alpha1+index) where index is the index of the responses you’re choosing from.