Silhouette
Updated
Draws a colored outline around the parts of the entity hidden behind other objects.
- Type
comp-silhouette- Script class
SilhouetteComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Outline and silhouette: 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 |
|---|---|---|
color |
"#f59e0b" |
|
thickness |
4 |
0 ≤ x ≤ 128 |
threshold |
0.05 |
0 ≤ x ≤ 10000 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
See a walker through a wallAmelia walks back and forth behind a wall; her Silhouette, in the runtime Outlines & Silhouettes demo's cyan, shows her outline wherever the wall hides her.
Watch the cyan outline follow Amelia while she is behind the wall. 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(SilhouetteComponent); if (component) log(component.props);}