Model
self:set_component_rendered
SharedSets 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_visibleto 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
| Type | Name | Description |
|---|---|---|
string | component | Path of the component to update Supports * as a wildcard to match multiple components by pattern |
bool | state | Determines the component's rendered state: • When true - the component is rendered• When false - the component stops rendering |
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")
entity:set_component_rendered("Skeleton3D/Hat", false)