Shared MR: Local Anchor Transfers in Unity

Copper Contributor

I'm trying to set up a common experience between two Hololens 2 devices in the same room, following


I made a fresh Unity 20.3.26f1 project, added and configured MRTK 1.0.2203.0, made a GameObject with a WorldAnchorManager component (not yet sure what to do with that), and then another GameObject with this script attached to it: 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.WSA.Sharing;

public class anchorscript : MonoBehaviour
    public GameObject rootGameObject;
    private UnityEngine.XR.WSA.WorldAnchor gameRootAnchor;

    // Start is called before the first frame update
    void Start()
        gameRootAnchor = rootGameObject.GetComponent<UnityEngine.XR.WSA.WorldAnchor>();

        if (gameRootAnchor == null)
            gameRootAnchor = rootGameObject.AddComponent<UnityEngine.XR.WSA.WorldAnchor>();

    // Update is called once per frame
    void Update()


This led to the following error in the Unity editor:


Assets\anchorscript.cs(4,26): error CS0234: The type or namespace name 'Sharing' does not exist in the namespace 'UnityEngine.XR.WSA' (are you missing an assembly reference?)


I'd appreciate any help understanding why this happens and what I can do to make the script compile.

1 Reply
world anchors are no longer be supported since unity version 2020