button - Activating/Deactivating GameObject Not Working -


i can't seem button activate gameobject. @ moment, have gameobject deactivating in scene, button doesn't activate gameobject. i'm missing in coding? script not attach gameobject.

#pragma strict   public var myobject :gameobject;       if (gui.button(new rect(1120,930,100,50),"3d object"))       {         myobject.setactive(true);      } 

i dont understand question but, first of if want use gui must in ongui function.

like:

function ongui () {      if (gui.button(new rect(1120,930,100,50),"3d object"))      {         myobject.setactive(true);      } } 

by way recommend that: use unity ui gui purposes.


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -