Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mocaponeuk · Nov 28, 2012 at 02:52 PM · c#vuforiamultipleglobalscope

How to detect multiple trackables in Vuforia

im a noob and i want to create a scene that has 10 trackables stored in it, when the ARcamera points at one trackable it quickly loads that scene, When it is pointed to another trackable it loads that one instead, So all the 10 scenes are looking for all 10 trackers.

What I did was to generate a dataset from the TMS that contains all 10 trackables. Adding this to the ARCamera of every scene that you're authoring. Adding each target to every scene, so that they are detectable and you can go from a given scene to any other.

The problem is it loads the first scene then it keeps loading it (ithink), as when i finds another tracker it just freeze until i point the device away.

I then edited DefaultTrackableEventHandler.cs (see attachment & below) link text

You will see I tried creating a flag so that it only loads a level if its not found the level its on,

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

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

if (mTrackableBehaviour.TrackableName == "01_Trackable" && LevelLoaded1.Level01IsRunning != 1){ Debug.Log("Trackable 01 found"); Application.LoadLevel ("Level_01");

}

if (mTrackableBehaviour.TrackableName == "02_Trackable" && LevelLoaded2.Level02IsRunning != 1){ Debug.Log("Trackable 02 found"); Application.LoadLevel ("Level_02");

}

if (mTrackableBehaviour.TrackableName == "03_Trackable" && LevelLoaded3.Level03IsRunning != 1){ Debug.Log("Trackable 03 found"); Application.LoadLevel ("Level_03");

}

if (mTrackableBehaviour.TrackableName == "04_Trackable" && LevelLoaded4.Level04IsRunning != 1){ Debug.Log("Trackable 04 found"); Application.LoadLevel ("Level_04");

}

if (mTrackableBehaviour.TrackableName == "05_Trackable" && LevelLoaded5.Level05IsRunning != 1){ Debug.Log("Trackable 05 found"); Application.LoadLevel ("Level_05");

}

if (mTrackableBehaviour.TrackableName == "06_Trackable" && LevelLoaded6.Level06IsRunning != 1){ Debug.Log("Trackable 06 found"); Application.LoadLevel ("Level_06");

}

if (mTrackableBehaviour.TrackableName == "07_Trackable" && LevelLoaded7.Level07IsRunning != 1){ Debug.Log("Trackable 07 found"); //Application.LoadLevel ("Level_07");

}

if (mTrackableBehaviour.TrackableName == "08_Trackable" && LevelLoaded8.Level08IsRunning != 1){

Debug.Log("Trackable 08 found");

//Application.LoadLevel ("Level_08");

}

if (mTrackableBehaviour.TrackableName == "09_Trackable" && LevelLoaded9.Level09IsRunning != 1){ Debug.Log("Trackable 09 found"); //Application.LoadLevel ("Level_09");

}

if (mTrackableBehaviour.TrackableName == "10_Trackable" && LevelLoaded10.Level10IsRunning != 1){ Debug.Log("Trackable 10 found"); //Application.LoadLevel ("Level_10");

}

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

 }

 
 

And in each level there is a game object with its own unique JS script attached with the following:

static var Level01IsRunning = 1; static var Level02IsRunning = 0; static var Level03IsRunning = 0; static var Level04IsRunning = 0; static var Level05IsRunning = 0; static var Level06IsRunning = 0; static var Level07IsRunning = 0; static var Level08IsRunning = 0; static var Level09IsRunning = 0; static var Level10IsRunning = 0;

function OnGUI () { GUI.Box (Rect (0,0,200,50), "level1"); }

It builds without error but when i run the APK on my phone and pint to the different trackables its stays on level 1 so the folling type bits are never true:

if (mTrackableBehaviour.TrackableName == "02_Trackable" && LevelLoaded2.Level02IsRunning != 1){

Please help...

Oh ive also moved all my JS scripts into the plugins folder as mentioned on other posts, doesnt seem to help on this occasion.

It now never loads any levelslink text

defaulttrackableeventhandler.zip (1.3 kB)
levelbits.zip (67.6 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Making a bubble level (not a game but work tool) 1 Answer

why camera is freezing while loading the 3D model 1 Answer

some idea of creating consecutive missions in a scene. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges