Model

self:set_component_lod_bias

Shared

Sets the LOD bias of one or more components on the model

Syntax

local status = self:set_component_lod_bias(
    component,
    bias
)

LODs are generated on load, the bias only sets how early each is used.

  • Values — 0 always uses the lowest LOD, 1 is the default.
  • Higher values — keep more detail at a greater distance.
  • Local only — a render setting on this client, never replicated to other peers.
  • Threshold — effective detail is roughly bias / threshold, see core.display.set_lod_threshold.

Parameters

TypeNameDescription
stringcomponentPath of the component to update
Supports * as a wildcard to match multiple components by pattern
floatbiasLOD bias to apply, negative values are clamped to 0

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Set the LOD bias of various components on a model
core.model.load("character", "models/character.glb")

local entity = core.model.create("character")

-- Keep the body detailed for longer
entity:set_component_lod_bias("Skeleton3D/Body", 2)

-- Force every component to its lowest LOD
entity:set_component_lod_bias("*", 0)

-- Restore the default on all wheels using a wildcard
entity:set_component_lod_bias("*Wheel_*", 1)

On this page