Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Hatdatsat · Dec 14, 2018 at 09:13 AM · networkremoteconnectingnetwork.connectmultiplatform

Hololens connect with pc Unet

Hello Everyone,

So I'm tasked recently by my boss to figure out how to make a hololens work.

So far I got some things to work with it but now the next step is to connect the hololens with a unity project that runs on the computer (while an app is running on the hololens aswell) Basically i need to create a dashboard on the computer that can give orders to the hololens.

I have been googling a lot and looking at previous question and most about this topic sadly go unanswered.

Some people have suggested using mixed reality toolkit examples, but for me that only gives errors on loading in the assets let alone use it alongside other code i need so that doesn't seem to be an option.

So far i have followed some unet tutorials and i got 2 unity apps working together with each other (on one computer) aswell as with 2 different computers. I basically used mostly the native unet where possible but i mostly made a custom hud so i can click in the hololens and connect to the host.

This code works on pc to pc and it also works when I use holographic emulation connected to the hololens, but when i build the app to the hololens it doenst connect to the server. below ill post the scripts I use so far.

there is a button script I only need to use for the hololens itself because on the computer I can just use ui buttons linked to the right script.

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();
     }
 }


Any help would be very much appreciated!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Hatdatsat · Dec 14, 2018 at 01:23 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

132 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Problem with basic networking... 1 Answer

Network.Connect not working - newbie question 0 Answers

Unet - adding [Command] function to Action C# 0 Answers

Network.Connect returns NoError but no connection? 0 Answers

showing 3rdparty app display in unity3d 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges