My Slider GameObject has a GUIText child. I am writing a C# script that should change the text component in the GUIText, but instead of this I am getting:
error CS1061: Type
UnityEngine.GUIText' does not contain a definition fortext' and no extension method
text' of typeUnityEngine.GUIText' could be found (are you missing a using directive or an assembly reference?)
public Slider timeSlider; int i = 5; timeSlider.GetComponentsInChildren<GUIText>().text = 'Some Text' + i; //timeSlider.transform.GetComponentsInChildren<GUIText>().text = 'Some Text' + i; // doesn't work either
From the documentation I understand that GUIText should have a 'text' variable - Would anyone know why ().text is invalid?
How the hierachy is: