Model

self:set_component_rendered

Shared

Sets whether a component of the model is rendered

Syntax

local status = self:set_component_rendered(
    component,
    state
)

Rendered state is separate from visibility.

  • See self:set_component_visible to toggle the component's visibility instead.
  • A component that stops rendering is kept alive, so it can be rendered again later without reloading the model.

Parameters

TypeNameDescription
stringcomponentPath of the component to update
Supports * as a wildcard to match multiple components by pattern
boolstateDetermines the component's rendered state:
• When true - the component is rendered
• When false - the component stops rendering

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Stop rendering a component
core.model.load("character", "models/character.glb")

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

entity:set_component_rendered("Skeleton3D/Hat", false)

On this page