Log in or register to post comments

Vuforia Unity - Why my ImageTargetTemplate is null?

April 2, 2016 - 6:49pm #1

Hi, Im working in a Vuforia project and I need to know why my ImageTargetTemplate variable is null.

This is my code:

 

  1. public class CloudRecoEventHandler : MonoBehaviour, ICloudRecoEventHandler
  2. {
  3. public ImageTargetBehaviour ImageTargetTemplate;
  4. ................................
  5.  
  6. public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
  7. {
  8. if (!ImageTargetTemplate)
  9. ShowText += " HERE EVER IS NULL";
  10. ................................

 

  1. IEnumerator GetAssetBundle()
  2. {
  3. ................................
  4. www = new WWW(BundleURL);
  5. yield return www;
  6. AssetBundleRequest request;
  7. ................................
  8. try
  9. {
  10. request = www.assetBundle.LoadAssetAsync("king", typeof(GameObject));
  11. }
  12. catch (Exception)
  13. {
  14. throw;
  15. }
  16.  
  17. GO = Instantiate(request.asset, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
  18.  
  19. if (ImageTargetTemplate) /// NULLLLLL EVERRRRRR!!! WHY? ;(
  20. {
  21. ObjectTracker tracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
  22. tracker.TargetFinder.EnableTracking(TargetResults, ImageTargetTemplate);
  23. }
  24.  
  25.  
  26. if (ImageTargetTemplate)
  27. {
  28. GO.transform.parent = ImageTargetTemplate.gameObject.transform; ////////////// NEVER do it !!!!!!!!
  29. }
  30.  
  31. GO.SetActive(true);

Vuforia Unity - Why my ImageTargetTemplate is null?

October 26, 2016 - 4:41am #2

I'm having the exact same problem as you, did you find a solution? Thanks :)

Log in or register to post comments