Access unity Image.Alpha? Assets/Scripts/GUI/Missionupdate.cs(17,23): error CS1061: Type `UnityEngine.UI.Image' does not contain a definition for `Alpha' and no extension method `Alpha' of type `UnityEngine.UI.Image'

Gday Gang trying to access the Alpha property to gui image sop i can make it fade out over time for my mission update effect,

Assets/Scripts/GUI/Missionupdate.cs(17,23): error CS1061: Type UnityEngine.UI.Image' does not contain a definition for Alpha’ and no extension method Alpha' of type UnityEngine.UI.Image’ could be found (are you missing a using directive or an assembly reference?)

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Missionupdate : MonoBehaviour {

	public 	Image image;

	public float FadeTime = 12f;

	void Start() {
		image = GetComponent<Image>();
	}


	void Update (){
		image.Alpha -= 1 * FadeTime * Time.deltaTime;
	}
}

The Image itself has its alpha defined through its 1 property.

Once you have the color property you can get/set its alpha.

image.color.a -= 1 * FadeTime * Time.deltaTime;

the 1 class doesn’t have a member Alpha. It does, however, have a member 2.

Example:

Color newColor = image.Color;
newColor.a = 0.5f; // The alpha is now 50%. (or 256 / 2)
image.Color = newColor;

Keep in mind that in C#, image.Color works similarly to, say, transform.position. You cannot directly change the values of image.Color without resetting the entire value, like I did in the above code.