I have two text that shows in the first level of my game. My code is running perfectly only for one thing. What I am trying to do where it shows (Hi, Press enter to begin!), and when you do(press w to go forward and space to jump). The Enter key is working fine, but when I start the level, it shows both texts at once; is there any way to fix this? Here is the code I used:
using UnityEngine;
using System.Collections.Generic;
public class textswitch001 : MonoBehaviour {
public GameObject text001;
public GameObject text002;
void Update() {
if (Input.GetKeyDown(KeyCode.Return)) {
text001.SetActive(true);
text002.SetActive(false);
}
if (Input.GetKeyUp (KeyCode.Return)) {
text001.SetActive (false);
text002.SetActive (true);
}
}
}
thanks,
steel