Hello everyone, I’m new to programming but have been able to make a basic demonstration for a game that I am now trying to flesh out a bit. But I keep running into a problem.
I tried making a dialog system that ended up looking a bit like this:
public float conversation;
void Update(){
if (Input.GetKeyDown(KeyCode.Space)){
panel.SetActive(true);
text.text="Hello.";
conversation=1;
}
if (conversation==1 && Input.GetKeyDown(KeyCode.Space)){
conversation=2;
text.text="What's up?";
}
if (conversation==2 && Input.GetKeyDown(KeyCode.Space)){
panel.SetActive(false);
}
Basically what happens is I run the script (the trigger works fine so far) and it just skips through the entire dialog to the end. I’ve tried using .GetKeyDown, .GetKeyUp… and even having a float that would count down (countdown-= Time.deltaTime) and even to only read this part of the script if it is countdown<=0. None of these solutions has worked.
If anyone has ideas, please feel free to share because I’m at a bit of a loss.