Log in or register to post comments

AreaTarget as Unity adressable

SDK 10.0
August 11, 2021 - 2:32pm #1

I want to host Area Targets in the cloud for consumption in an Android APp.



I can upload download them alright.

 

But, I cant add the Dataset and AreaTarget Properties in the AreaTargetGame object at runtime.

 

I have looked at the source for the AreaTarget Test App, but cant extract alot of relevant information from it.

 

 Can anyone help?

--

 









 

SDK Version: 

AreaTarget as Unity adressable

September 7, 2021 - 2:19am #14

Sure! Glad to help.

 

Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

September 6, 2021 - 8:15am #13

Ok, now the error makes sense. 

I will deploy the code first, and then I will test it.

 

Thanks,

AreaTarget as Unity adressable

September 6, 2021 - 3:47am #12

Hey there,

 

The FEATURE_NOT_SUPPORTED error happens because you were using the Webcam play mode. Testing area targets during play mode only works in the Simulator or Recorder play modes.

Sadly you can only test area target during play mode when they're created before-hand, not at runtime. This is because the authoring mesh won't be visible when it's loaded during runtime. For testing I would recommend using the predefined area target behaviour and load the dataset for testing, and for the final app, load it during runtime. That way you can visualize the area target during testing.

I hope that helps.

 

Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

September 5, 2021 - 6:48pm #11

Hi Patrick,

I tried to use the solution you provided here for Jack.

 

Unfortunately it does show me the following error:

ObserverNotCreatedException`1: Failed to create AreaTargetObserver: FEATURE_NOT_SUPPORTED.

Vuforia.Internal.Core.ObserverFactory.CreateAreaTargetObserver (Vuforia.Internal.Observers.DeviceObserver deviceObserver, System.String dataSetPath, System.String targetName) (at <f8eea962600042608a43a95bfdce1273>:0)

Vuforia.ObserverFactory.CreateAreaTarget (System.String databasePath, System.String targetName) (at <f8eea962600042608a43a95bfdce1273>:0)

LoadAreaTargetViaRuntime.LoadDatasetModel (System.String name, System.String xml, System.String path, System.Boolean isGLBAreaTarget) (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:93)

LoadAreaTargetViaRuntime.LoadAreaTarget (System.String name, System.String xml, System.String path) (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:157)

LoadAreaTargetViaRuntime+<LoadAreaTargetDataAsync>d__9.MoveNext () (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:74)

UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <a0ef933b1aa54b668801ea864e4204fe>:0)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 

 

Does it mean my license does not support this feature or I am missing something else? Currently, I am using a free developer license.

Also, when I switch the "PlayMode" in "Vuforia Configuration" to "Simulator", it does show me the following warning, instead of the aforementioned error:

 

AreaTargets created at runtime are not supported in Simulator Play Mode.

UnityEngine.Debug:LogWarning (object)

Vuforia.Internal.Utility.UnityLogger:LogWarning (string)

Vuforia.Internal.Utility.Log:Warning (string)

Vuforia.Internal.Simulator.SimulatedObjectFactory:CreateAreaTargetVisualization (Vuforia.AreaTargetBehaviour)

Vuforia.Internal.Simulator.SimulatedObjectFactory:CreateSimulatedObject (Vuforia.ObserverBehaviour)

Vuforia.SimulatedObserverRegistry:RegisterWithObserver (Vuforia.Internal.Observers.IObserver,Vuforia.ObserverBehaviour)

Vuforia.World:ObserverBehaviourCreated (Vuforia.Internal.Observers.IObserver,Vuforia.ObserverBehaviour)

Vuforia.ObserverBehaviour:RegisterObserver (Vuforia.Internal.Observers.IObserver)

Vuforia.ObserverFactory:CreateAreaTarget (string,string)

LoadAreaTargetViaRuntime:LoadDatasetModel (string,string,string,bool) (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:93)

LoadAreaTargetViaRuntime:LoadAreaTarget (string,string,string) (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:157)

LoadAreaTargetViaRuntime/<LoadAreaTargetDataAsync>d__9:MoveNext () (at Assets/Scripts/LoadAreaTargetViaRuntime.cs:74)

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

Regards.

Amir

AreaTarget as Unity adressable

September 3, 2021 - 7:47am #10

Thanks Patrick Will try it out

AreaTarget as Unity adressable

August 31, 2021 - 10:52am #9

Hey there,

 

Attached you find two scripts LoadAreaTargetViaRuntime and DirectoryScanner. I created the LoadAreaTargetViaRuntime class based on the Area Target Test App (which I highly recommend going through) and DirectoryScanner is a class of that app with some useful helper methods.

You should do the following:

  1. Unzip and add the files to your project
  2. Add LoadAreaTargetViaRuntime to any game objects
  3. Place your area target folder in the StreamingAssets folder
  4. Set DataSetName to your area target (folder) name 

The class will create the area target on start. It will go through the StreamingAssets and find the folder based on its name. Please check if this works.

I sadly wasn't able to verify on a device, but if it doesn't work, it probably is related to the StreamingAssets path which you might have to change.

As I described, I recommend downloading the Area Target Test App (you can download it here) and go through it deeply. You can find the most relevant classes attached to the ARCamera.

I hope that helps.

 

Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

August 31, 2021 - 7:08am #8

Sorry again for the delay. I will respond with some sample code to help you get along in a few hours!

 

Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

August 26, 2021 - 3:43am #7

Any luck?

AreaTarget as Unity adressable

August 20, 2021 - 1:34pm #6

Much appreciated

AreaTarget as Unity adressable

August 19, 2021 - 6:09am #5

Hey there,

 

I'm sorry for the delay in response. I'm currently finding the best way to create an area target during runtime and will report back as soon as possible. Once I find the best way to do that, I will make sure the documentation gets updated accordingly to make it easier to understand how to create targets during runtime.

 

Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

August 17, 2021 - 8:35am #4

Thanks for the response Patrick.

Having said that you missed the question.

As I said below I have not problem downloading content at runtime.

Like you say asset bundles are one way.



So my question ISNT  about downloading area targets. 

My question once an area target is downloaded how do I incorporate that Area Target Database at runtime and associate it with content?



Thanks 

AreaTarget as Unity adressable

August 16, 2021 - 7:29am #3

Hey there,

 

There are multiple ways to dynamically load targets into Unity. I would recommend using Unity's Asset Bundles.

Here's the article that explains how to create and load asset bundles here: https://library.vuforia.com/unity-extension/package-augmentations-unity-assetbundles

Hope that helps!



Kind regards,

Patrick Scheper

Technical Community Manager

AreaTarget as Unity adressable

August 15, 2021 - 7:49am #2

HI There, I would also like to achieve the same. This is probably the biggest factor holding me back from purchasing Vuforia at the moment. 

My use case is in creating a location agnostic app, where once u determine in the app the location you are at, it will load the appropriate AreaTarget(s) from the cloud.

Log in or register to post comments