Home > front end >  Loaded scene element isn't fully displayed
Loaded scene element isn't fully displayed

Time:10-18

Summary
I'm creating a menu for Hololens app. Following the documentation it has to be split in 3 parts:

  1. an empty scene
  2. a menu scene
  3. a random scene

The empty scene is the one defined in MRTK Scene System so it will always be displayed. This one has to be empty and load the menu scene.

The problem
The app start, the empty scene load the menu scene but I only find the back plate and the text I put on the back of the plate. The buttons can't be found anywhere. Here are some pictures from Unity

What I've tried
Following this sample from Microsoft I added the following script in my empty scene :

using System.Collections;
using System.Collections.Generic;
using Microsoft.MixedReality.Toolkit;
using UnityEngine;
using UnityEngine.SceneManagement;

public class LoadMenu : MonoBehaviour
{
    private static bool IsFirstLoad = true;
    private void Start()
    {
        if (IsFirstLoad)
        {
            IsFirstLoad = false;
            CoreServices.SceneSystem.LoadContent("menu", LoadSceneMode.Single);
        }
    }
}

and I created my menu scene like this. I took the same settings as the sample for the position of the buttons and the back plate, when I launch the sample it's working but on my app I can't figure out where are the buttons

[EDIT] to debug I even added a cube which is visible, but I can't find my buttons as you can see on this picture

CodePudding user response:

You should create a new scene for menu and set that as start scene in the project settings or else by default it will not show, because when the game starts it needs a scene to display.

CodePudding user response:

It is difficult for me to check the issue from the screenshots you provided. Would you also try to reproduce this issue with prefabs provided by MRTK? Please refer to Buttons - MRTK 2 | Microsoft Learn and Near menu - MRTK 2 | Microsoft Learn to start using these prefabs.

  • Related