Unity C# Change Object Transparency

Subscribers:
33,700
Published on ● Video Link: https://www.youtube.com/watch?v=hXUMdWXr2so



Duration: 3:34
46,002 views
0


The only commands you need for this one are:

1. Declare a float variable
2. GetComponent SpriteRenderer, setting the fourth value to the float declared in step 1.
3. A statement to change that float variable based on some condition.

I included the Keycode commands really just as a quick way of changing the alpha value. Instead you could change the alpha variable based on a collision or based on passage of time or some other factor.







Tags:
C# (Programming Language)
Unity (Software)