Hey! as the title said im trying to make a game where it pops up a dialouge when i start the game. But when i press the buttons nothing happens. i have put in the OnClick() on the button objects.
it seems to be a problem with the buttons because the load scene thing isnt working either.
The public strings is probably not needed? but it looks cool
my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Talk : MonoBehaviour {
public GameObject DialougeObj;
public Text Question;
public Text Answear1;
public Text Answear2;
public Text Answear3;
public string QuestionString;
public string Answear1String;
public string Answear2String;
public string Answear3String;
void Start()
{
Answear3.gameObject.SetActive(false);
QuestionString = "Do you want to play the tutorial?";
Answear1String = "Yes!";
Answear2String = "No!";
}
void Update()
{
Question.text = QuestionString;
Answear1.text = Answear1String;
Answear2.text = Answear2String;
Answear3.text = Answear3String;
}
public void Answear1Butt()
{
Answear2.gameObject.SetActive(false);
Answear3.gameObject.SetActive(false);
QuestionString = "Use WASD to move" +
"1 for pistol, 2 sword, 3 for weapon3" +
"Easy right?, now play the tutorial map and then through the portal!";
Answear1String = "Yes, sir!";
}
public void Answear2Butt()
{
DialougeObj.SetActive(false);
SceneManager.LoadScene("Main World");
}
}