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

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

  • Options
    SanderSander
    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

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