Changing ScreenOverlay Intensity

I have a blood splat effect using the ScreenOverlay image effect when my player is hit. I want this to fade away over a few seconds but it won’t!

The intensity is set to 0 to begin with and when the player gets hit, I start a coroutine to change it to 1, then waitforseconds(0.2f), then set to 0.8, then wait…etc etc

When the player is hit, the splat appears on screen with intensity 1 but stays at 1 and doesn’t reduce and I have no clue as to why!

This is the coroutine…

IEnumerator Splatter ()
	{
		splatFX.intensity = 1f;
		yield return new WaitForSeconds (0.2f);
		splatFX.intensity = 0.8f;
		yield return new WaitForSeconds (0.2f);
		splatFX.intensity = 0.6f;
		yield return new WaitForSeconds (0.2f);
		splatFX.intensity = 0.4f;
		yield return new WaitForSeconds (0.2f);
		splatFX.intensity = 0.2f;
		yield return new WaitForSeconds (0.2f);
		splatFX.intensity = 0f;
	}

Hi, first of all you wouldn’t code that like that, try this:

public IEnumerator SplashEffect() {
	while(splatFX.intensity >= 0) {
		splatFX.intensity -= 2 * Time.deltaTime; // 2 = effect duration / velocity
		yield return new WaitForFixedUpdate();
	}
}

Next step is that I have no clue what splatFX is, so I can’t say if splatFX.intensity is teh right way to set the visibility in the game.