Log in or register to post comments

TrackableEventHandler script on multiple gameobjects question

November 27, 2015 - 5:00am #1

Hi,

I need a little help to understand this behaviour.

I have the DefaultTrackableEventHanlder script put in 4 gameobjects and in that class I wrote a function to download some different files for each gameobject (Gameobject 1 download the file A, Gameobject 2 download the file B, etc).

Using Vuforia I focus a image with the camera device and each image is linked to a one gameobject above, then when the gameobject is recognized the script run and the download begin.

The problem is that focusing the Image A, for instance, Unity not run the script download put on gameobject A only BUT ALL scripts download put on ALL gameobjects. The result is that all files are downloaded and not the request file only.

Why?!?

Please, help me, many thanks.

 

TrackableEventHandler script on multiple gameobjects question

December 2, 2015 - 5:56pm #2

fabiocarucci wrote:

The problem is that focusing the Image A, for instance, Unity not run the script download put on gameobject A only BUT ALL scripts download put on ALL gameobjects. The result is that all files are downloaded and not the request file only.

Sounds like same code in multiple registered event handlers is being called. I'd suggest placing Debug.Log() statements in each of your handler methods to see how they are being called. You can also step through your code with the debugger.

http://docs.unity3d.com/430/Documentation/Manual/Debugger.html

 

Log in or register to post comments