Hey guys,
I am working on creating an app in hololens however I am having trouble get the menu centered. We have it setup to where the user can either walk or use a Xbox controller. The issue is that the button used to enable/disable the menu doesn’t always place it in the screen center. I fear that since we have the camera is the child of the empty game object that is used to move the camera, that it is causing issues with the alignment.
I am thinking of attempting to it create when pressed very similar to the TaptoPlace script and have it Destroy upon closing. I just need the menu to be centered when called upon. Any thoughts or advice would be amazing. Thank you for your time
The best result i have got so far is the following script:
if (controllerInput.GetButton(ControllerButton.View))
{
Menu.SetActive(true);
Menu.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height / 2, Camera.main.nearClipPlane + 0.5f));
}