1
\$\begingroup\$

I am making a VR game for the quest with Unity and for a trial I have a microphone with a button that you have to press and say a specific phrase. For that I am using the Voice SDK but I have a problem, it works in the editor but not once I compile and install the APK, I have the microphone permission so that is not the issue.

My GameObject that acts as a button is this:

Microphone Button

And the Microfono script is like this:

private void OnTriggerEnter(Collider other)
{
    if (other.tag == "dedo" && !triggerActivated)
    {
        triggerActivated = true;
        appVoice.Activate(GetRequestEvents());
     }
}
// Set the events for the Voice
private VoiceServiceRequestEvents GetRequestEvents()
{
    VoiceServiceRequestEvents events = new VoiceServiceRequestEvents();
    events.OnInit.AddListener(OnInit);
    events.OnComplete.AddListener(OnComplete);
    return events;
}
// What happens when the button is pressed
public void OnInit(VoiceServiceRequest request){
    micro.GetComponent<Outline>().enabled = false;
    verde.SetActive(true);
    rojo.SetActive(false);
}
// What happens when the transcription is complete
public void OnComplete(VoiceServiceRequest request){
    triggerActivated = false;
    verde.SetActive(false);
    rojo.SetActive(true);
}

The OnTriggerEnter method does work, I tried to place the verde.SetActive(true); before the appVoice activation and it did activate a green light when touching the microphone. Also the GameObject has a child GameObject with the response script (maybe it could go into the parent) like this:

Response

Any ideas why this might work on the editor and not on the Quest 3? It does not even launch the OnInit event because this line: micro.GetComponent<Outline>().enabled = false; should remove the outline around the object and it does not work.

Some info that I forgot and may be useful, I use Meta XR All-in-One SDK version 62 and Unity 2022.3

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .