c# - Unity SetActive doesn't work -


i got problem. trying hide agameobject using setactive(false); object still shown in game.

here code:

public class test : monobehaviour {      public gameobject a;     public gameobject b;       void start () {         a.setactive (false);         b.setactive (false);     } } 

(going off presumptions here, please correct if not scenario)

in order work, a , b need gameobjects in actual scene. not work prefabs because prefabs aren't ever in scene, they're copied in.


Comments