Hi, I want to make a "For" like this:
for (float i = 0; i <= 1; i+=0.1F)
{
BSMaterial.color = new Color(BSColor.r, BSColor.g, BSColor.b, BSColor.a - i);
yield return new WaitForSeconds(0);
Debug.Log(BSMaterial.color.a);
}
but it gains a Wrong value when I = 0.7, then "I" comes with "0.6900001" and all values after this comes wrong making an infinite loop.
Mathf.Round don't worked for me, since Mathf.Round round a number to 1.
Sorry if I said something wrong, and thanks for helping me.
↧