Log in or register to post comments

Trackable identifiers?

January 16, 2013 - 10:21pm #1

Hey guys,

Basically i have 3 different trackables(pages) and i have set up a custom trackable event handeler to play a sound on track but if the track is lost it continues to play until it has finished the audio or unless another page is activated. The next part i need to figure out is if another trackable gets activated and i go back to the first page that the audio will trigger again.

so at the moment im using 3D sound clips and distancing my trackables in unity world space, from what i can tell if a track is lost the ARCamera will remain in its last tracked position(this is what has made this method work). but if i can find a way of identifying the trackable i can activate audio depending on the pages and use 2D clips.

Is anyone able to help me with this?

From what i can tell the trackables all have names but they are strings and im not sure if there is a way to do an if statement on a string?

also for simplicity sake i would prefere to stay in C# if possible?

~Steve

You're welcome

January 18, 2013 - 12:01am #5

You're welcome

That seems to be working!

January 17, 2013 - 2:18pm #4

That seems to be working! thankyou!!

That seems to be working!

January 17, 2013 - 2:18pm #3

That seems to be working! thankyou!!

Hi Steve, you can definitely

January 17, 2013 - 12:30am #2

Hi Steve,

you can definitely compare strings in C# scripts (and so build if-else conditions on trackable names), for instance this code is pefectly valid:

 

if ( mTrackableBehaviour.TrackableName.Equals("chips") )
{
    // DO SOMETHING ...
}
else if ( mTrackableBehaviour.TrackableName.Equals("stones") )
{
   // DO SOMETHING ELSE ...
}
else 
{
     // DO SOMETHING ELSE
}
 
Does it help ?
Log in or register to post comments