Model
self:set_component_lod_bias
SharedSets 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 —
0always uses the lowest LOD,1is 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, seecore.display.set_lod_threshold.
Parameters
| Type | Name | Description |
|---|---|---|
string | component | Path of the component to update Supports * as a wildcard to match multiple components by pattern |
float | bias | LOD bias to apply, negative values are clamped to 0 |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
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)