Log in or register to post comments

How to enable and disable guideview through button

June 30, 2020 - 3:27am #1

Hi all! I'm trying to implement a button to show a guideview of a model target, basically when the button is pressed a script attached to the model target with a function is called. The function is: 

public void GuideView()

    {

        modelTargetBehaviour.GuideViewMode = ModelTargetBehaviour.GuideViewDisplayMode.GuideView2D;

    }

Actually nothing is appearing on the screen, could it be that the canvas is hiding the guideview? Is there any solution?

thanks to all

How to enable and disable guideview through button

July 1, 2020 - 7:03am #6

Hi,

I made it exactly like you did. But you are trying to do some other things in your project as well. And if I get it right, I think it is not possible because you can't track 2 model target at once except you have an advanced model target dataset with more train objects.

You could do is show a button with the first model target where you can load the other one. When you click the button the first would stop tracking and the second guide view would appear.

Let me know if that fits for you and I show you how to do that.

 

How to enable and disable guideview through button

July 1, 2020 - 1:13am #5

hi,

could you share your project to see how you made it?

thanks, 

riccardo

How to enable and disable guideview through button

July 1, 2020 - 1:03am #4

already checked that solutions, my doubt is regarding when implementing the switch between two model target. I'm using the default trackable event handler script on the first model target to make appear the second one but nothing is happening. I have attached a pic with my settings. Is this correct? The guideview script is attached to all model target I am using, could it be an issue? 

Here my guideview script: 

 

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using Vuforia;

public class GuideViewScript : MonoBehaviour

{

   public  ModelTargetBehaviour modelTargetBehaviour;

    void Start()

    {

       

       // modelTargetBehaviour = this.GetComponent<ModelTargetBehaviour>();

        modelTargetBehaviour.GuideViewMode = ModelTargetBehaviour.GuideViewDisplayMode.NoGuideView;

       

    }

     public void GuideView()

    {

        modelTargetBehaviour.GuideViewMode = ModelTargetBehaviour.GuideViewDisplayMode.GuideView2D;

    }

}

AttachmentSize
Image icon Cattura.JPG58.59 KB

How to enable and disable guideview through button

June 30, 2020 - 5:07am #3

Hi,

this works for me...

You don't get any error messages?

How to enable and disable guideview through button

June 30, 2020 - 4:53am #2

Hi,

Check out the resolution here https://developer.vuforia.com/forum/model-targets/enable-disable-guide-view-mode

Based on the Unity API info here: https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1ModelTargetBehaviour.html#af7446a44b3e7c1b1973f1d07abfc0fdcaffed0bff4998023b6d30982c4f42c1d2 the option that you need to use to remove the Guideview is: NoGuideView

Thank you.

Vuforia Engine Support

Log in or register to post comments