Sprite smooth fade out/in

So I wrote a little code for my sign to “Smoothly fade out/in”.

Sprite appears and disappears as intended however it doesn’t fade smoothly.

void Start () {
	myTrigger = GetComponent<Collider2D>();
	booble = whichSpriteToFade.GetComponent<SpriteRenderer> ();

void Update(){
	isTouchingSign = Physics2D.IsTouchingLayers (myTrigger, whoIsPlayer);
	if (isTouchingSign) {
		Debug.Log ("Is touching sign it's fading in");
		fade = Mathf.SmoothDamp (0f, 100f, ref fadespeed, fadeTime);
		booble.color = new Color (1f, 1f, 1f, fade);

	} else {
		Debug.Log ("Is not touching sign it's fading out");
		fade = Mathf.SmoothDamp (100f, 0f, ref fadeoutspeed, -fadeTime);
		booble.color = new Color (1f, 1f, 1f, fade);


The problem is that, just like RGB values, the alpha value goes from 0 to 1. However, you are trying to make it go from 0 to a 100 so you will never actually see the fading , since the only values that matter go from 0 to 1 but you are basically skipping that. So replace the 100f with a 1f inside your SmoothDamp functions.


I did that however sprite only gets the first value which is 0.16 a and stops there.