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.
Options

Video not working/freezing up. Killcode wont work.

I tried creating a tagalong with a video texture. the video plays, but there's like 2 frames per second when its supposed to be over 30. in addition, I added a code to close the app and go back to the HoloLens Desktop. that code, which is shown below, does not appear to work. also, how do I get this video to wait until after another program is finished?

using UnityEngine;
using System.Collections;

public class EndCreditScript : MonoBehaviour {
// Use this for initialization
public AudioClip TargetSoundEffect;
private AudioSource audioSource;
void Start()
{
Renderer[] rendererArray = this.gameObject.GetComponentsInChildren();
foreach (Renderer r in rendererArray)
{
r.enabled = false;
}
foreach (Collider c in GetComponentsInChildren())
{
c.enabled = false;
}
EnableAudioHapticFeedback();
}
private void EnableAudioHapticFeedback()
{
// If this hologram has an audio clip, add an AudioSource with this clip.
if (TargetSoundEffect != null)
{
audioSource = GetComponent();
if (audioSource == null)
{
audioSource = gameObject.AddComponent();
}

        audioSource.clip = TargetSoundEffect;
        audioSource.loop = true;
        audioSource.playOnAwake = false;
        audioSource.spatialBlend = 1;
        audioSource.dopplerLevel = 0;
    }
}

// Update is called on render command
void GoodbyeVideo()
{
    Renderer[] rendererArray = this.gameObject.GetComponentsInChildren<Renderer>();
    foreach (Renderer r in rendererArray)
    {
        r.enabled = true;
    }
    foreach (Collider c in GetComponentsInChildren<Collider>())
    {
        c.enabled = true;
    }
    if (audioSource != null && !audioSource.isPlaying)
    {
        audioSource.Play();
    }
    ((MovieTexture)GetComponent<Renderer>().material.mainTexture).Play();
    if (!audioSource.isPlaying)
    {
        Application.Quit();
    }
}

void OnSelect()
{
    Renderer[] rendererArray = this.gameObject.GetComponentsInChildren<Renderer>();
    foreach (Renderer r in rendererArray)
    {
        r.enabled = false;
    }
    foreach (Collider c in GetComponentsInChildren<Collider>())
    {
        c.enabled = false;
    }
    audioSource.Stop();
}

}

P.S: I already used simplygon to reduce as many models as I could. I also changed all materials to holotoolkit shaders. I noticed a major change in file size and the "Made in Unity" bootup took an average of ten seconds less (still 25 seconds though). the video showed no signs of improvement, leading me to believe something else is the problem. Thanks.

Answers

  • Options

    Did you buy the video texture? I've been trying to create an app on Unity to play videos on the hololens, it seems the only way to do that is to buy a movie texture for Unity3d and implement it? Were you building using D3D or Xaml? Could you link the video texture you've been using?

    I used a sample movie texture that worked fine when played in Unity, but once I deployed it to the Hololens nothing in the app loaded (just an empty screen).

Sign In or Register to comment.