Skip to content

World visuals

The game exposes WorldVisuals, LineRenderer and SurfaceOverlay. The SDK helpers create those same native objects, apply common settings in one call and optionally remove them later.

World visuals are client-only presentation. They do not create server entities, colliders or gameplay effects.

import { visuals } from "@killscript/sdk/client";
const line = visuals.line({
points: [start, end],
color: new Color(0, 1, 1, 1),
width: 0.02,
duration: 3,
});

The helper sets the native position count and translates the ordinary TypeScript points array to the zero-based indexes expected by LineRenderer.SetPosition().

Useful line options:

OptionPurpose
pointsOrdered world-space points; required
colorColor of the whole line
widthBase line width
progressVisible progress along the line
patternEnabledEnables a pattern texture
patternRepeatPattern repetition value
patternTextureNative Texture used by the pattern
occludedBrightness / occludedTransparencyNative occluded-visibility values
durationRemoves the object after this many seconds
const marker = visuals.overlay({
position: hit.Point,
size: new Vector3(1, 0.02, 1),
color: new Color(1, 0.2, 0.2, 0.55),
fillBase: 1,
occlusionEnabled: true,
visible: true,
});

An overlay is useful for an impact point, selected area or temporary world marker. position and size use world coordinates. The remaining fields map directly to the corresponding native SurfaceOverlay setters.

Both helpers may return undefined when the game cannot create the native object. Handle this naturally when later code needs to call a native method:

const path = visuals.line({ points });
path?.SetProgress(0.5);

Use duration for a self-expiring effect:

visuals.overlay({
position,
size: new Vector3(0.5, 0.02, 0.5),
duration: 1.5,
});

Remove a longer-lived object explicitly:

visuals.remove(marker);

Or let a toggleable feature own it:

import { scope, visuals } from "@killscript/sdk/client";
const active = scope();
active.world(visuals.line({ points: [start, end] }));
// Removes the line together with the feature.
active.dispose();

Removal is idempotent inside the generated SDK runtime. It is safe when a duration timer and a feature scope both refer to the same object.

The returned values remain native LineRenderer and SurfaceOverlay objects. Use their documented methods directly for a less common change the helper does not expose.