Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Using Voice Commands

I am trying to turn off a layer using HoloToolKit keywordmanager and I have it partially working. The parent layer (Plane) is turning off but the children layers are not (Buttons).
This is the script that I am using...
Any help would be appreciated!

using System.Collections;
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;

public class HideLayer : MonoBehaviour
{
public void showHidePlane()
{
if(GetComponent().enabled == true)
{
GetComponent().enabled = false;
}
else
{
GetComponent().enabled = true;
}
}
}

Best Answer

Answers

  • Hey,
    are you using the current HoloToolkit? It labels the Keyword-Manager as obsolete. It would be better to use the SpeechInputSource- and SpeechInputHandler-Scripts.

    When I try out your code. I get an error at "GetComponent()" as there is no type specified. Usually you would use
    GetComponent<"Type you are looking for">()

    Where do you check the layers? Maybe you can place the buttons as children of your plane. In that case you can just toggle the Plane and the children follow suit.

    Something like:

    public void HideLayer()
    {
      Plane.SetActive(!Plane.activeSelf);
    }
    
  • holonutholonut
    Answer ✓

    Thank you for your response! I have started another thread that I hope you can provide input in.
    It is based off of your initial feedback of eliminating keywordmanager script...

    https://forums.hololens.com/discussion/8327/voice-commands-using-holotoolkit#latest

Sign In or Register to comment.