Log in or register to post comments

On Trackable Found ?

July 8, 2011 - 1:59pm #1

Just a quick question - what's the new function that detects when a new trackable is found? And, where is it located? The old TrackableScript.cs is no longer there!

On Trackable Found ?

July 13, 2012 - 9:03am #6

Attach that script to the ImageTarget instance instead. Then you can check for the 'win' target using

 

if( mTrackableBehaviour.TrackableName.Equals("win") ){

// do something

}

On Trackable Found ?

July 12, 2012 - 2:12pm #5

Renesis wrote:

ina wrote:

Reviving this.. Can you provide a code snippet for when a trackable is detected (and also identifies which trackable) 

 

It is already included in DefaultTrackableEventHandler.cs, there are methods OnTrackingFound() and OnTrackingLost().

For example:

 

private void OnTrackingFound() { Renderer[] rendererComponents = GetComponentsInChildren(); // Enable rendering: foreach (Renderer component in rendererComponents) { component.enabled = true; } Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found"); }

 

This code attached at ARCamera and show the image target name when detected??i try to write a script which when arcamera detect a image target named "win" then run this myGUItext.gameObject.active = true;}

On Trackable Found ?

July 6, 2012 - 4:40am #4

ina wrote:

Reviving this.. Can you provide a code snippet for when a trackable is detected (and also identifies which trackable) 

 

It is already included in DefaultTrackableEventHandler.cs, there are methods OnTrackingFound() and OnTrackingLost().

For example:

 

 
    private void OnTrackingFound()
    {
        Renderer[] rendererComponents = GetComponentsInChildren<Renderer>();

        // Enable rendering:
        foreach (Renderer component in rendererComponents) {
            component.enabled = true;
        }

        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
    }
 

On Trackable Found ?

July 6, 2012 - 4:13am #3

Reviving this.. Can you provide a code snippet for when a trackable is detected (and also identifies which trackable) 

Re: On Trackable Found ?

July 8, 2011 - 2:13pm #2

I think you are looking for the TrackableEventHandler.cs from the ImageTargets sample that implements ITrackableEventHandler ?

Log in or register to post comments