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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -