- Home /
Trying to create a basic dialouge box (Newb)
I started learning C# today and I'm trying to wrap my head around variables and states by creating a speech bubble that you can click through. I'm getting no compiling errors and I don't know how to make this work, any advice? :(
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class TextController : MonoBehaviour {
public Text text;
int message = 1 ;
private enum States {message};
private States myState;
// Use this for initialization
void Start () {
myState = States.message;
}
// Update is called once per frame
void Update () {
if (myState == States.message) {
state_message();
if (Input.GetKeyDown(KeyCode.Return)) { ;
message = + 1;
}
}
}
void state_message () {
if(message==2)
text.text = "My name is Fiona!" ;
if(message==3)
text.text = "How are you today?" ;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612151302im_/https://answers.unity.com/themes/thub/images/avi.jpg)