- Home /
Question by
Abacab · May 15, 2015 at 12:08 PM ·
gameobjectmenualphasetactive
SetActive or GetComponent().alpha
Hello!
Which one of these is easier to handle for mobile devices:
GameObject.SetActive(true/false); or GameObject.GetComponent().alpha = 1/0;
Thanks in advance!
Comment
Best Answer
Answer by Landern · May 15, 2015 at 12:40 PM
Using SetActive will ensure that all components are also inactive. This is not the case with setting the alpha to enforce transparency. Alpha will not kill rigidbodies or colliders etc and could/may/will lead to very silly things going on in your game scene(probably).
Just to add setting alpha would also require additional unnecessary computations on shader side for transparency.