Markers
Markers display shapes and icons in the game world, such as checkpoint cylinders,
arrows and vehicle symbols. Client scripts create them with Marker.
Create a marker
Section titled “Create a marker”This example places a cylinder near the beach spawn. The constructor takes a marker type, position and RGBA color, followed by optional streaming settings. Here, automatic streaming is enabled with a distance of 60 metres.
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
const marker = new revo.Marker( revo.MarkerType.VerticalCylinder, { x: -1220, y: -1765, z: 3.9 }, { r: 80, g: 180, b: 255, a: 150 }, true, 60,);
marker.scale = { x: 6, y: 6, z: 1 };Revo draws active markers each frame. Create each marker once and update its properties when needed. You can set properties immediately after construction, including while the marker is outside streaming range.
Appearance
Section titled “Appearance”| Property | Use |
|---|---|
markerType |
Choose a shape from MarkerType, such as VerticalCylinder, HorizontalCircleSkinny, ChevronUp1 or CarSymbol. |
pos |
World position in metres. Adjust its height to place the marker at the intended surface. |
scale |
Scale along the X, Y and Z axes. Defaults to { x: 1, y: 1, z: 1 }. Each component must be positive and finite. |
color |
An { r, g, b, a } object with integer channels from 0 to 255. Alpha 0 is transparent and 255 is opaque. |
rot |
Rotation around the X, Y and Z axes, in radians. |
dir |
Direction vector passed to the marker renderer. Defaults to { x: 0, y: 0, z: 0 }. |
faceCamera |
Makes the marker face the camera. Defaults to false. |
rotate |
Enables the marker’s rotation effect. Defaults to false. |
bobUpAndDown |
Enables vertical bobbing. Defaults to false. |
The chosen marker type affects how scale, direction and rotation look. Check the result in-game when changing types.
Vector and color getters return copies. Assign the property to apply a change,
for example marker.scale = { x: 4, y: 4, z: 1 }. Changing marker.scale.x
alone does not update the marker.
Visibility and streaming
Section titled “Visibility and streaming”Set marker.visible = false to hide it and true to show it again when streaming
allows. Visibility defaults to true.
Automatic streaming is enabled by default. Without an explicit distance, the
marker uses the world’s stream distance. Set marker.streamDistance to a positive
finite distance in metres, or null to return to that default.
A new marker starts in dimension 0. Set marker.dimension for another
dimension, or use globalDimension to make it available in every dimension.
See Dimensions and visibility.
marker.isStreamedIn reports whether the marker is active. Streaming out preserves
the object and its settings. At most 2,000 markers can be active on one client at
once, across all resources. Additional markers wait for streaming capacity.
Use markers for interactions
Section titled “Use markers for interactions”A marker does not detect players entering its area. Add a colshape for enter and leave events. Keep their positions and dimensions together when moving an interaction. Marker scale and colshape geometry are separate settings, and hiding the marker leaves the colshape active.
Markers are local to the client that creates them. For a shared checkpoint or destination, send its data from the server and create a marker on each relevant client. Validate gameplay actions on the server as described in the colshape guide.
Remove a marker
Section titled “Remove a marker”Call marker.destroy() when it is no longer needed. It becomes invalid and stops
drawing. Repeated calls have no effect. Markers created by a resource are also
removed when that resource stops.