- Home /
GUI Text Not Rendering - Solved
Hello,
I made created GUI Text and attached a C# script with the following code below:
using UnityEngine;
using System.Collections;
public class BtnHome : MonoBehaviour
{
void OnMouseEnter()
{
renderer.material.color = Color.red;
}
void OnMouseExit()
{
renderer.material.color = Color.white;
}
}
Like it says above, the text should turn red when the mouse hovers over the text and should turn white when it hovers off the text.
However, that doesn't happen. So, how do I fix this?
Comment
Best Answer
Answer by Eric5h5 · Jul 07, 2012 at 04:58 AM
If you're using a GUIText component then you're not using a renderer component; it's guiText.material.color.
Your answer
Follow this Question
Related Questions
GUI text font change 3 Answers
Limit on GUI Components? 0 Answers
Using "fonts" that are actually images for a multi-outline effect. 2 Answers
Dialouge text. 1 Answer
Unity GUI text displaying as noise 1 Answer