error cs0103 unity the name text does not exist in the current context and same for the button what can i do plz someone help Asap
using UnityEngine; using System.Collections;
public class GameplayController : MonoBehaviour { public static GameplayController instance;
[SerializeField]
private Text scoreText;
[SerializeField]
private Text endScore;
[SerializeField]
private Text BestScore;
[SerializeField]
private Text gameOvertext;
[SerializeField]
private button d;
private
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
} heres the complete code.
Answer by Salman_Saleem · Aug 15, 2016 at 05:17 AM
You have to use UnityEngine's UI namespace in order to use the UI components in the scripts.
Add using UnityEngine.UI; at the start of your script below using System.Collections;
Answer by AliMumtaz · Dec 04, 2016 at 06:09 PM
thanks man it got fixed by me i didn't notice it but thank you for your reply appreciate it:)
Your answer
Follow this Question
Related Questions
How to assign a value to buttons, every button would multiply each other and update a text 2 Answers
MRTK Figma Bridge for Unity 0 Answers
Instantiating Button/Text Prefab Does Not Work 0 Answers
Combine text and buttons in scroll rect 0 Answers
UI Text Editing Problem, What's Wrong? Need Anybody to Assist 1 Answer