So I have a GUI labels text color set to a color variable called targetColor. I have targetColor lerping from white to a red color variable, depending on a float. Dragging the float variable between 0-1 in the inspector during play mode does not lerp it. If it is less than 0.99 it will instantly go white, if it is 1 it will go red. What’s going on? This follows the documentation example perfectly.
Edit: Here’s my example code as requested: (I’m adjusting colorLerp in the inspector for now)
public GUIStyle healthStyle;
public Color targetColor;
public Color normalTextColor = new Color(255,255,255,255);
public Color damageTextColor = new Color(135, 0, 0, 255);
public float colorLerp = 0;
void Start(){
colorLerp = 0;
}
void Update(){
targetColor = Color.Lerp(normalTextColor, damageTextColor, colorLerp);
healthStyle.normal.textColor = targetColor;
}
void OnGUI(){
GUI.Label(new Rect(...), "Text", healthStyle);
}