This is amazing! I’ve tried all 3 solutions:
- The one in the lecture
- The CrossFadeAlpha method
- This “Canvas Group” method
The Canvas Group method is the best because:
- It’s most intuitive to set up
- It requires the simplest code
- It allows the user to click around as it fades (the user doesn’t have to wait for the fade to finish in order to click)
For anyone wondering how to replicate:
-
In Unity, in the 01a Start scene, click on Canvas
-
Click Add Component, then add the “Canvas Group” component
-
Set alpha to 0
-
Add Component, make a script, code below (don’t forget to add in the UnityEngine.UI too):
public float fadeInDelay; private CanvasGroup canvasGroup; void Start() { canvasGroup = GetComponent<CanvasGroup>(); } void Update() { canvasGroup.alpha += Time.deltaTime / fadeInDelay; }
Hope that helps and thanks again @BlackPhi for finding this!
-Blaine