1

I have two different Unity projects, one is a HoloLens application and the other is the desktop application. My goal is to manipulate an object in the HoloLens application through the desktop application. At the moment I have Unet working when the HoloLens is the host and the desktop acting as the client. Manipulating through the HoloLens and transferring that to the desktop application works, but it doesn't vice versa. I am unable to connect to the desktop application when it serves as the server. I am guessing this has something to do with the anchoring of objects in world position, but I am not sure.

Someone else suggested that the HoloLens could be the server and that the client could send commands to the server through methods with the [Command] implementation. I added a playerPrefab on the desktop application so that it would be recognized as a player which would enable me to send those commands. Unfortunately, this doesn't seem to work. This results in the following error message: "Spawn scene object not found for 1". Adding the prefab to the scene and dragging it on the NetworkManager as a player, but that results in an object that isn't an actual player(disabling me from sending commands to the server).

I did find a different approach: granting authority to the non-player object. I tried to do this as follows:

  1. Start the server on the HoloLens
  2. Connect to the desktop application
  3. Invoke an Rpc-method to assign client authority

This, unfortunately, results in a different error message: "Found no receiver for incoming [-1367249836] on Liver(UnityEngine.GameObject), the server and client should have the same NetworkBehaviour instances[netId=1]"

What I basically want to achieve is to have a non-player object(since the desktop application is purely used to manipulate the object in the HoloLens) be able to make changes to the object on the server(HoloLens).

Sou
  • 25
  • 7
  • They shouldn't be two different applications. They need to be the same one. – Dtb49 Mar 30 '18 at 13:54
  • The reason I chose to have two different application is because one project would have the mixed reality settings applied and the other not. Wouldn't using the same application result into an error for the desktop application? Can I dynamically apply the proper settings by using SystemInfo.deviceType? – Sou Mar 31 '18 at 19:58
  • If you don't use the same project, then you will either not see stuff happening on one end or you get a bunch of errors. You can build them to Target different devices but they need to be part of the same project. Most mixed reality settings are checked at runtime. – Dtb49 Mar 31 '18 at 20:08

1 Answers1

0

I agree with the above comment that it should be developed in the same project. We successfully created an remote support application at work that allowed a desktop user to interact with a HoloLens user. We accomplished this by developing two scenes inside one Unity project.

  1. Desktop scene
  2. HoloLens scene

By doing so, we were able to draw on the same scripts to make the application work across all devices. (We had to throw in some if statements to make some of the code device specific). For the desktop part, 3D scene had no problems building.

TheCascadian
  • 485
  • 3
  • 14
  • Thanks a lot. Got it to work by splitting it up into two scenes in one project like you suggested. – Sou Apr 03 '18 at 14:35