When I finished my story and ran my game, I found that the text would stay on “New text” or unchanged text. I have tried to brake the code down and this is what I have. I still have no idea why it wont change the text. The text in my unity is named “Text” and the script is place inside that said text. I also am see a print in the console if I insert the print function into “state_cell” yet I cant change the text. Thanks for the help ahead of time.
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
public class TextController : MonoBehaviour {
public Text text;
private enum States {cell}
private States myState;
// Start of game
void Start() {
myState = States.cell;
}
// Function caller
void Update() {
print(myState);
if (myState == States.cell) {
state_cell();
}
}
void state_cell() {
text.text = "Test";
}
}