> For the complete documentation index, see [llms.txt](https://unity.progdocs.se/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unity.progdocs.se/tillaeggspaket/mrtk-hololens/spatial-awareness.md).

# Spatial awareness\*

* MRTK XR Rig -> Camera Offset
  * Skapa objekt med "ARMeshManager"-komponent
  * Skapa en prefab med ett MeshFilter och rätt material
    * OBS: Ta bort specifika mesh:et i MeshFilter-delen! Annars kommer det att *redigeras permanent*.
    * MeshCollider
* Simulering (Inte fått detta att funka ännu)
  * Edit->Project Settings
    * XR Plug-in Management->Windows, Mac & Linux
      * Kryssa i XR Simulation
  * Window->XR->AR Foundation->XR Environment
    * Install sample environments
    * Import sample environments

{% embed url="<https://localjoost.github.io/Using-ARMeshManager-for-Spatial-Awareness-with-MRTK3-on-HoloLens-2/>" %}

{% embed url="<https://localjoost.github.io/MRTK3-StatefulInteractable-gaze,-hover-and-select-events-and-how-to-use-them/>" %}

OLD MRTK2:

* MixedRealityToolkit
  * Spatial Awareness
    * Enable Spatial Awareness System (kräver egen övergripande Configuration Profile)
    * Observers
      * Alla ändringar kräver egen MixedRealitySpatialAwarenessSystemProfile
      * För simulering
        * Lägg till
        * Type: Microsoft.MixedReality.Toolkit.SpatialObjectMeshObserver → SpatialObjectMeshObserver
      * Alla ändringar i enskilda observers kräver egna Profiles för varje.
        * Display Settings – Visible / Occlusion
      * Ändra saker i Observers
        * using Microsoft.MixedReality.Toolkit;
        * using Microsoft.MixedReality.Toolkit.SpatialAwareness;&#x20;
        * using Microsoft.MixedReality.Toolkit.SpatialObjectMeshObserver;
        * var observers = (CoreServices.SpatialAwarenessSystem as IMixedRealityDataProviderAccess).GetDataProviders();


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unity.progdocs.se/tillaeggspaket/mrtk-hololens/spatial-awareness.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
