Quantcast
Channel: Recent Discussions — Mixed Reality Developer Forum
Viewing all articles
Browse latest Browse all 10543

Spectator View Setup - No NetworkDiscoveryWithAnchor objects

$
0
0

I am setting up Spectator View for a project that's under an NDA. This is my first time doing this, and I'm already running into some trouble regarding anchors.

On following the steps as outlined here:
https://www.andreasjakl.com/how-to-set-up-hololens-spectator-view-part-3-first-real-life-test/
one of the errors I get is as follows:

NullReferenceException: Object reference not set to an instance of an object SpectatorView.JoinSelectedSessionButton.Update () (at Assets/Addons/HolographicCameraRig/SV_UNET/Prefabs/Support/Scripts/UI/JoinSelectedSessionButton.cs:32)

Line 32 of JoinSelectedSessionButton.cs is
if (networkDiscovery.running && networkDiscovery.isClient)

The error exists because the static variable Instance of type NetworkDiscoveryWithAnchors is assigned null, as the starting code for that class did not find any objects that are of type NetworkDiscoveryWithAnchors. This debug output explains:

Expected exactly 1 SpectatorView.NetworkDiscoveryWithAnchors but found 0 UnityEngine.Debug:LogFormat(String, Object[]) SpectatorView.NetworkDiscoveryWithAnchors:get_Instance() (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/NetworkDiscoveryWithAnchors.cs:33) SpectatorView.SpectatorViewManager:Update() (at Assets/Addons/HolographicCameraRig/Scripts/SpectatorViewManager.cs:298)

Right now in my scene I don't have any anchors. But before I add one into place, I want to make sure that upon adding one, this line
NetworkDiscoveryWithAnchors[] objects = FindObjectsOfType<NetworkDiscoveryWithAnchors>();
will return an array of length one.

I did try having the hologram I want to anchor to as a child of a game object with the NetworkDiscoveryWithAnchors script. That didn't work. I also tried making the hologram as a child of the UNetAnchorRoot game object that's part of the Sharing prefab.

What am I supposed to do? I feel like I don't need to do anything except just add an anchor to the scene (which I don't know how quite yet).


Viewing all articles
Browse latest Browse all 10543

Trending Articles