How do I make objects fade away?

You need to use set scalar parameter value on materials instead of just set scalar parameter value.