SceneNode \ XR Anchors
On mixed-reality headsets, an XR anchor pins a virtual object to a spot in the real room, so it stays put as the user walks around — and appears in the same place the next time the scene starts on that headset. These nodes anchor an object where it currently is, or release it again.
What's on this page
- Anchor Object — Pins a 3D object to the real-world spot where it is right now, so it stays put in mixed reality.
- Unanchor Object — Releases an anchored object from its real-world spot, so it is no longer pinned there.
Anchor Object
Pins a 3D object to the real-world spot where it is right now, so it stays put in mixed reality.
What it does
In mixed reality the headset shows your virtual objects on top of the real room. Anchoring an object ties it to the real-world spot it occupies at that moment. As the user walks around, the headset keeps tracking that spot and the object stays fixed on it — a virtual pump placed on a real workbench stays on that workbench instead of slowly drifting away.
The headset also saves the anchor, so the next time the scene runs on that headset the object goes back to its anchored spot by itself. Anchors work on Meta Quest, PICO and HTC VIVE headsets. On any other device the node does nothing and the object behaves as usual. Running the node doesn’t move or change the object; it only fixes where it is.
Inputs
| Port | Type | What to connect |
|---|---|---|
| Execute | Trigger | Wire this from the previous node’s Execute output. |
| SceneNode | Scene node | The object to pin in place. It must be listed in the scene’s XR Anchors dialog (see the first tip); for any other object nothing happens. You can connect more than one object to anchor them all. |
Outputs
| Port | Type | What you get |
|---|---|---|
| Execute | Trigger | Fires right away. The headset finishes creating and saving the anchor a moment later, in the background. |
| SceneNode | Scene node | The same object passed straight through, so you can chain more nodes onto it. |
Example
| SceneNode input | A virtual pump model the trainee has just placed on a real workbench |
| SceneNode output | The same pump, now pinned to that spot on the workbench |
Tips
- Set the object up first. In SimLab Composer, open the VR workbench’s Interact menu → XR Anchors, click Add XR Anchor, and pick the object as the Anchor Node with a unique Anchor Name. The headset saves the anchor under that name.
- Reuse an Anchor Name across scenes to place objects at the same real-world spot: another scene whose object has the same Anchor Name picks up the spot saved on that headset.
- Let the user move the object to the right spot first (for example by grabbing it), then anchor it. The anchor is taken from wherever the object is when this node runs.
- Anchoring an object that is already anchored does nothing. To pin it somewhere else, use Unanchor Object, move the object, then anchor it again.
- HTC VIVE headsets can save only a limited number of anchors. When that limit is reached, the oldest saved anchor is removed to make room for the new one.
Unanchor Object
Releases an anchored object from its real-world spot, so it is no longer pinned there.
What it does
Removes the anchor that Anchor Object created. The object stays exactly where it is right now, but it is no longer tied to the real room, so you can move it again.
The headset also forgets the saved spot. The next time the scene runs, the object appears at its normal position from the scene instead of returning to the old real-world spot. If the object isn’t anchored, isn’t listed in the scene’s XR Anchors dialog, or the headset isn’t a Meta Quest, PICO or HTC VIVE, nothing happens.
Inputs
| Port | Type | What to connect |
|---|---|---|
| Execute | Trigger | Wire this from the previous node’s Execute output. |
| SceneNode | Scene node | The anchored object to release. It must be listed in the scene’s XR Anchors dialog (VR workbench → Interact → XR Anchors). You can connect more than one object to release them all. |
Outputs
| Port | Type | What you get |
|---|---|---|
| Execute | Trigger | Fires right away. The headset finishes removing the saved anchor a moment later, in the background. |
| SceneNode | Scene node | The same object passed straight through, so you can chain more nodes onto it. |
Example
| SceneNode input | The virtual pump model pinned to the real workbench |
| SceneNode output | The same pump, still on the workbench but free to be moved to a new spot |
Tips
- Other scenes that use the same Anchor Name share the saved spot on that headset, so unanchoring here releases it for them too.
- To move an anchored object to a new spot, unanchor it, let the user place it again, then run Anchor Object.