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.
Draw a line
Section titled “Draw a line”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:
| Option | Purpose |
|---|---|
points | Ordered world-space points; required |
color | Color of the whole line |
width | Base line width |
progress | Visible progress along the line |
patternEnabled | Enables a pattern texture |
patternRepeat | Pattern repetition value |
patternTexture | Native Texture used by the pattern |
occludedBrightness / occludedTransparency | Native occluded-visibility values |
duration | Removes the object after this many seconds |
Mark a surface
Section titled “Mark a surface”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);Own and remove visuals
Section titled “Own and remove visuals”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.