- Home /
Can't open dialogue box when pressing button
Hey hello,
I am currently following the Unity Dialogue & Quest course on Udemy, still a bit of a beginner. In the lecture you can open the dialog when pressing the mouse button. However am making a game on mobile and want to implement a UI Button where the player can click to talk on.
However I currently have not found a solution on how to implement the button to open the dialogue. The transparent white box is the button this is the code:
public bool OpenDialagueButton(PlayerController callingController) {
dialogueButton.onClick.AddListener(() =>
{
callingController.GetComponent<PlayerConversant>().StartDialogue(dialogue);
});
return true;
}
PlayerConversant playerConversant;
public void StartDialogue(Dialogue newDialogue) { currentDialogue = newDialogue; currentNode = currentDialogue.GetRootNode(); onConversationUpdated(); }
Your answer
Follow this Question
Related Questions
Add Listeners to array of Buttons 2 Answers
Why are my UI elements hidden behind the background? 3 Answers
How can i create a conversion like whatsapp in unity3d 0 Answers
positioning ui buttons in a scrollview 1 Answer
OVRInput keys are not working 0 Answers