# Spatial Anchors not working in Unreal Engine Examples project

**URL:** <https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199>\
**Category:** Unreal Engine\
**Tags:** unreal, anchors\
**Created:** [September 10, 2024, 6:30pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199 "2024-09-10T18:30:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexisEspejel](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@AlexisEspejel](https://forum.magicleap.cloud/u/AlexisEspejel)\
**Post date:** [September 10, 2024, 6:31pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/1 "2024-09-10T18:31:00Z")

</div>

Hi, I am trying to run the example for Spatial Anchors in Unreal Engine but it isn't working, I am following what I believe is the proper procedure in the example to add a spatial anchor or to try to query them but I'm not getting anything and no matter what I do I can't seem to get it to work in either the Examples project or in my own. I took a look at the error and warning logs and apparently it is looking for a few extensions that it says are not available but I don't know how to add them either.

**Magic Leap SDK version** : 1.9.0  
**Unreal Engine version** : 5.4.3  
**ML2 OS version** : 1.9.0

**These are the Error and Warning messages from logs** :

**Warnings** :  
LogHMD: Warning: Required extension XR\_ML\_world\_mesh\_detection is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_spatial\_anchors is not available  
LogHMD: Warning: Required extension XR\_ML\_spatial\_anchors\_storage is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_pixel\_sensor is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_light\_estimation is not available  
LogHMD: Warning: Required extension XR\_ML\_world\_mesh\_detection is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_spatial\_anchors is not available  
LogHMD: Warning: Required extension XR\_ML\_spatial\_anchors\_storage is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_pixel\_sensor is not available  
LogHMD: Warning: Required extension XR\_EXT\_future is not available  
LogHMD: Warning: Required extension XR\_ML\_light\_estimation is not available  
LogStreaming: Warning: Failed to read file '../../../Engine/Plugins/Developer/PlasticSourceControl/Resources/Icon128.png' error.

**Errors** :  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogMagicLeapSpatialAnchors: Error: EnsureStorage: SpatialAnchors plugin failed to initialize, check for earlier errors  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.  
LogXRDeviceVisualizationComponent: Error: CreateRenderComponent returned a NULL UPrimitiveComponent\*. Setting a NULL StaticMesh.

---

<div class="post-metadata">

**Author:** ![aheaney](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aheaney](https://forum.magicleap.cloud/u/aheaney)\
**Post date:** [September 10, 2024, 9:56pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/2 "2024-09-10T21:56:55Z")

</div>

Hello,

Welcome to the forums! Sorry about the trouble. Let's see if we can troubleshoot. Here are a few questions-

Did you build Unreal Engine yourself from source or are you using a binary install of UE 5? If you compiled the engine yourself, did you get the source code from the MagicLeap repo and if so what branch did you use to compile?

Are you trying to run the examples natively on your ML2 or are you using remote rendering?

Have you been able to run any of the other levels in the examples project or run any other basic UE app on your ML2?

Thanks!  
Adam

---

<div class="post-metadata">

**Author:** ![AlexisEspejel](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@AlexisEspejel](https://forum.magicleap.cloud/u/AlexisEspejel)\
**Post date:** [September 11, 2024, 12:41am UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/3 "2024-09-11T00:41:04Z")

</div>

I built the engine from source, and I did get the source code from the MagicLeap repo, using this command:

```auto
git clone --single-branch https://github.com/MagicLeapUnreal/UnrealEngine.git

```

As instructed by the Getting Started guide.

I am trying to run the examples using remote rendering, and I was able to successfully run all the levels in the project except for WorldMesh and SpatialAnchors. I have also been able to run another personal UE app through remote rendering as well.

Thank you!

---

<div class="post-metadata">

**Author:** ![aheaney](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aheaney](https://forum.magicleap.cloud/u/aheaney)\
**Post date:** [September 11, 2024, 6:57pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/4 "2024-09-11T18:57:16Z")

</div>

Hello,

Unfortunately, that's expected. Neither world mesh, nor spatial anchors are currently supported by MagicLeap remote rendering. However, those examples should work if you build and package the examples project and run it natively on your ML2.

Best,  
Adam

---

<div class="post-metadata">

**Author:** ![AlexisEspejel](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@AlexisEspejel](https://forum.magicleap.cloud/u/AlexisEspejel)\
**Post date:** [September 17, 2024, 6:17pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/5 "2024-09-17T18:17:56Z")

</div>

Hello again,

I tried running the examples natively in my ML2 from a build and they do in fact work, thank you!

Are there any plans to get the world mesh and spatial anchors to work via remote rendering in the future?

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [September 17, 2024, 7:22pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/6 "2024-09-17T19:22:21Z")

</div>

aheaney , correct me if I'm wrong, Support for Spatial anchors and Meshing in Remote Rendering are currently not on our roadmap, but I have shared your interest in these features with our voice of customer team.

As an alternative to Spatial Anchors, you can try using the Localization Map API, which allows you to query the map origin. This origin point can be used similar to an anchor.

After mapping your environment with the Spaces app you can also save the Mesh of the environment on your device. You could use this mesh as an alternative to real-time meshing depending on your app's needs.

Note: The OpenXR Localization Map Feature is Experimental in Remote Rendering.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/bd9b737a4d45ea243aa7eb177d60a773b806899a.svg) [@system](https://forum.magicleap.cloud/u/system)\
**Post date:** [October 2, 2024, 7:23pm UTC](https://forum.magicleap.cloud/t/spatial-anchors-not-working-in-unreal-engine-examples-project/4199/7 "2024-10-02T19:23:06Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
