I'm trying to make this RectTransform fade in. It has an script which controls the alpha value of the canvas renderer of it and its children as detailed by http://answers.unity3d.com/questions/780323/unity-ui-fading-canvaspanel.html
so using this script I have done the following:
Set RectTransform as inactive
Activate RectTransform with Alpha set to 0 in start function.
Animate the Alpha variable to go from 0 to 1.
between steps 1 and 2 it seems like it takes a little to realize that it has to set Alpha to 0 and so it creates this flicker which I don't like. My guess is that the canvasrenderer takes a frame to run the start function causing this. ¿Any ideas on how to tackle this issue?
Answer by hexagonius
Mar 19 at 10:35 AM
had this too. Call Canvas.ForceUpdateCanvases() after initializing the values.
Or set them in Awake.
It seems like that was it! thanks. Setting them in awake worked perfectly, the other function also worked but I think that the awake method is way more useful for my purposes.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
Unity UI - Fading Canvas/Panel
[CanvasGroup] alpha on children as combined (merged) texture?
Why do contents of nested Panel spill outside parent?
Screen to canvas space
How to get accurate x/y for Rectangle Transform of Panel under canvas?