World markers¶
Use :world for a label, health bar or quest marker that must stay over a point in the level while the camera moves.
The WorldMarker sample has a label that stays over a cube in the level. "Move" moves the cube sideways and the label follows
it; a second "Move" moves it back. Run it by choosing WorldMarker in the samples list in the map L_ArcRmlSamples
(Samples).

:world¶
:world="Expr" places an element over a point in the world. The value is a string of three numbers separated by
whitespace, "x y z" in centimetres. The document sets the element's transform to a translate to the point's place on
the screen each time the point or the camera changes.
<body :model="marker">
<div id="wm-marker" class="wm-marker" :world="Anchor">
<div class="wm-label">Target</div>
</div>
.wm-marker {
position: absolute;
left: 0;
top: 0;
}
.wm-label {
transform: translate(-50%, -100%);
}
Limits
- The anchored element needs
position: absolute; left: 0; top: 0: the translate starts from the element's own layout position, so that position must be the top-left corner of the screen. - The element's own
transformis overwritten by:world. An offset of your own goes on a child:translate(-50%, -100%)on.wm-labelcentres the label over the point and puts it above.
:worldneeds a:modelon the element or an ancestor, like every data attribute; without one it does nothing.- The element is hidden before its first UI update, while the point is behind the camera, and while the view has no camera.
The value¶
The sample's view model keeps Anchor as a string and refreshes it every frame while the document is open.
bool UArcRmlSamplesWorldMarkerViewModel::UpdateAnchor(float DeltaTime)
{
if (const AActor* Actor = Target.Get())
{
const FVector Location = Actor->GetActorLocation();
UE_MVVM_SET_PROPERTY_VALUE(Anchor, FString::Printf(TEXT("%.1f %.1f %.1f"), Location.X, Location.Y, Location.Z));
}
return true;
}
The sample's Open function finds the cube by its actor tag SampleMarkerTarget and hands it to the view model, which updates
Anchor on a ticker while the document is open. UE_MVVM_SET_PROPERTY_VALUE sends the value only when it changed.
- An empty or whitespace-only value hides the element without an error, so the label stays hidden until your code first
sets
Anchor. To hide it again when the target is gone, set an empty string; the sample does not, so its label stays at the last point. - Any other value that is not three finite numbers hides the element and logs one error per view:
:world on element <address>: '<text>' is not a world point "x y z". - The camera is the one of the owning local player.