I have three tags, all under a UI category, so the tags are called:
UI/SpeedText
UI/GearText
UI/rpmMeter
Here is a piece of my script:
void Start(){
Car = GetComponent<Rigidbody> ();
SpeedText = GameObject.FindWithTag ("SpeedText").GetComponent<Text> ();
gearText = GameObject.FindWithTag ("GearText").GetComponent<Text> ();
rpmMeter = GameObject.FindWithTag ("rpmMeter").GetComponent<RectTransform> ();
float Average = (MaxGrip + MinGrip) / 2;
TurnLowValue = Average * MaxTurnSpeed * 5;
TurnHighValue = TurnLowValue * 6;
multiplierValue = 1 / MaxGrip;
}
Strangely, it is able to find SpeedText and GearText, but it says that rpmMeter is not a defined tag. It is worth noting that if I remove UI before it so that the tag is just rpmMeter, it is able to function properly.