Log in or register to post comments

Disable Default Event Behaviour for VuMarks/ImageTarget

June 16, 2017 - 5:46am #1

Hey,

 

I just started using Vuforia and Unity.

I am using Visual Studio and C# and could not find a solution for the following problem. Maybe I just lack of understanding.

 

As far as I see, the "DefaultTrackableEventHandler.cs" will enable/show the child components of the VuMark/ImageTarget in the scene in Unity.

 

I created my own EventHandler using ITrackableEventHandler which works totally fine. At moment it just does nothing but writing to the Debug.log.

My problem is that I removed the "DefaultTrackableEventHandler" Component from the VuMark/ImageTarget in Unity, but still the child elements will be enabled when I look at the VuMark or Image.

I tried debugging with break points to find out where the event for this behaviour is, but I can't find it.

 

After looking a lot through the documentation and forum for Vuforia I still found no solution.

 

Would appreciate any help for that. Thank you.

Disable Default Event Behaviour for VuMarks/ImageTarget

June 26, 2017 - 11:41am #6

Hi JanSch,

I tested in the AR-VR sample found in the vuforia-samples-eyewear-unity-6-2-10 using the Vuforia-3-AR-VR scene and am seeing what you are referring to here. In this scene there is a script called "TransitionManager.cs" with a function called "UpdatedVisibleObjects." This function is modifying the visibility of various objects in the scene and is interfering with turning off the child objects in the image target within this scene.

I downloaded the basic sample project (the one you can get from the Unity asset store) and pulled open the Vuforia-3-ImageTarget scene. In this scene I turned off the child object in an ImageTarget and it would remain off when building and testing, as expected. This object still has the DefaultTrackableEventHandler script attached to it.

If this is different from what you're seeing, could you provide me with a sample that demonstrates the incorrect behavior that you're describing?

Disable Default Event Behaviour for VuMarks/ImageTarget

June 26, 2017 - 3:17am #5

Hi Strasza,

thanks again for your reply. When removing all behaviours except the "ImageTargetBehaviour" and "TurnOffBehaviour", the child elements will still be enabled. I used the vuforia-samples-eyewear-unity-6-2-10.zip sample.

Disable Default Event Behaviour for VuMarks/ImageTarget

June 20, 2017 - 9:21am #4

I pulled down the sample project and modified an object to only contain the 3 behaviors you describe in your post. When I build and test the app I don't see any of the child elements being enabled. Can you test and see if it works this way for you in the sample? You might have something else on your object or in your scene modifying these elements.

Thanks.

Disable Default Event Behaviour for VuMarks/ImageTarget

June 20, 2017 - 3:22am #3

Hi Strasza,

thank you for your reply. I am not using the sample, I use the ImageTarget and VuMark prefab from the SDK.

The only scripts attached to the VuMark in my case are "VuMarkBehaviour", "TurnOffBehaviour" and the "VuMarkEventHandler". The last one is the one I mentioned below.

So my problem cannot be solved by removing the "Model Swap" because it doesn't exist in my case.

 

Disable Default Event Behaviour for VuMarks/ImageTarget

June 16, 2017 - 9:41am #2

Hello JanSch,

If you're modifying the Vuforia Sample and no longer want your image targets to affect the sample models you can remove the "Model Swap" script from the Image target objects. This modifies the visibility of the sample teapot objects.

Thanks.

Log in or register to post comments