Basic Material
Updated
Unlit flat color that ignores lights.
- Type
comp-basic-material- Script class
BasicMaterialComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Materials: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
opacity |
0 ≤ x ≤ 1 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
An unlit marker that ignores the lightsThe lights dim and come back every few seconds: the Standard sphere darkens with them, while the Basic material sphere keeps its full colour, because a Basic material is never lit.
Watch the left sphere darken with the lights while the Basic sphere on the right stays bright. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(BasicMaterialComponent); if (component) log(component.props);}