O'Reilly logo

HoloLens Beginner’s Guide by Jason Odom

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

World Anchor code

Here, we will implement World Anchors. We will go through what we add line by line and learn what everything means. Just to set expectations, this next section is almost entirely code-based.

In our fields and properties area, we need to add the two lines that are at 11 and 12 in the picture below. Depending on how you have your own code written, these numbers may not line up exactly, but should be close; this screenshot shows you the code that surrounds it to give reference points:

In the first of the two lines, we are creating a string to give our anchor a name.

The second line will be used to get a reference to our WorldAnchorManager ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required