Log in or register to post comments

debbug vufoia code button

November 16, 2012 - 3:06am #1

Hello. can you help me with this script.

look my problem in this video http://www.youtube.com/watch?v=Hl6qLOmia2Q

i have this code attach to the GUItexture button. and at the end another script attach to th 3d Teapot. both are java script. when im out the tracker image, the 3d teapot still appear when toching the button. I need that the GUItexture button work only when appear the tracker image.

var enabledState:boolean=true;

var vuforiaVisible:boolean=false;

var myObject : GameObject;

var yourScriptInstance : MyScriptName;

function Start(){

myObject = GameObject.Find("teapot");


//MyScriptName is your script with var enabledState:bool=true;var vuforiaVisible:bool=false;

} function Update () {

if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began){

if (guiTexture.HitTest(Input.GetTouch(0).position)){



myObject.renderer.enabled=myScript.enabledState!=m yScript.enabledState




the script attach to the 3d teapot object

#pragma strict

function Start () {


var enabledState:boolean=true;var vuforiaVisible:boolean=false;

function Update () {


debbug vufoia code button

November 16, 2012 - 3:36am #2

Hi, please avoid posting the same question multiple times;

you posted already in here:


Please follow up with the link above

Log in or register to post comments