Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

Hololens Unet

Hello All,

So I'm still rather new to Hololens but I have been messing around with it a bit and a got most things I want working so far but now I'm starting to run into a problem.
I have been googling to look for help but so far most answer havent really helped me so I'm here to ask how to get Unet working with Hololens. (im not using mixedrealitytoolkit examples sharingwithUnet since it keeps throwing errors when i try to load and using it in unity with all the versions i have tried)

So I have been able to connect my unity project between 2 different pc's and when i use holographic emulation with connection to my hololens it can connect aswell to my server pc.
But when i build to hololens it cant seem to connect to the server.

I'm using unity 2018.2.13f1

Any help would be appreciated!

I'll show the code i have used so far for the Unet:

This is the networkManager:

_using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System;

public class NetworkManager_Custom : NetworkManager {

 public void StartupHost() {
     setPort();
     NetworkManager.singleton.StartHost();
 }

 public void JoinGame() {
     SetIpAddress();
     setPort();
     NetworkManager.singleton.StartClient();
 }

 private void SetIpAddress() {
     string Address = "192.168.10.120";
     NetworkManager.singleton.networkAddress = Address;
 }

 private void setPort() {
     NetworkManager.singleton.networkPort = 7777;
 }

}_
and here is the code i use for the button to join the network:

_using UnityEngine;
using UnityEngine.UI;

public class ButtonNetwork : MonoBehaviour
{
NetworkManager_Custom manager;
public Text text;
public MeshRenderer m_ButtonHighlight;

 private void Start() {
     manager = GameObject.Find("GameManager").GetComponent<NetworkManager_Custom>();
 }    
 public void OnGaze(bool hasGaze)
 {
     m_ButtonHighlight.enabled = hasGaze;
 }

 public void OnSelect()
 {
     text.text = "Pressed";
     manager.JoinGame();
 }

}_

Best Answer

  • SanderSander
    Accepted Answer

    Okay so it seems my code wasn't at fault!

    I was trying to connect to the unity editor project on my pc but Hololens can not connect to the editor but it can connect to a build version.

Answers

  • SanderSander
    Accepted Answer

    Okay so it seems my code wasn't at fault!

    I was trying to connect to the unity editor project on my pc but Hololens can not connect to the editor but it can connect to a build version.

Sign In or Register to comment.