By Tucmagames
on Fri, 04/08/2016 - 20:36
Hi, Im working in a Vuforia project and I need to know why my ImageTargetTemplate variable is null.
This is my code:
public class CloudRecoEventHandler : MonoBehaviour, ICloudRecoEventHandler
{
public ImageTargetBehaviour ImageTargetTemplate;
- ................................
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
{
if (!ImageTargetTemplate)
ShowText += " HERE EVER IS NULL";
- ................................
IEnumerator GetAssetBundle()
{
- ................................
www = new WWW(BundleURL);
yield return www;
AssetBundleRequest request;
- ................................
try
{
request = www.assetBundle.LoadAssetAsync("king", typeof(GameObject));
}
catch (Exception)
{
throw;
}
GO = Instantiate(request.asset, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
if (ImageTargetTemplate) /// NULLLLLL EVERRRRRR!!! WHY? ;(
{
ObjectTracker tracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
tracker.TargetFinder.EnableTracking(TargetResults, ImageTargetTemplate);
}
if (ImageTargetTemplate)
{
GO.transform.parent = ImageTargetTemplate.gameObject.transform; ////////////// NEVER do it !!!!!!!!
}
GO.SetActive(true);
I'm having the exact same
I'm having the exact same problem as you, did you find a solution? Thanks :)