AI Caption
Updated
Shows the owning Agent’s Speech To Text output as transient text.
- Type
comp-ai-caption- Script class
AICaptionComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Dialog and captions: 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 |
|---|---|---|
fontSize |
0. |
|
insetX |
- |
|
insetY |
- |
|
padding |
0 ≤ x ≤ 16384 |
|
panelOffset |
||
panelOffset.x |
||
panelOffset.y |
||
panelOffset.z |
||
panel |
||
panel |
||
panel |
||
panel |
||
panelWidth |
0. |
|
pixelSize |
0.001 ≤ x ≤ 1 |
|
screenScale |
0.1 ≤ x ≤ 1 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
An AI Caption shows what the guide's AI Speech To Text hears: her own lines spoken through the browser's voice, and the Radio, which an AI Speech Capture marker selects for transcription.
Press Next line: the guide speaks with your browser's voice and her caption appears above her, also in the log. Transcribing the Radio needs the AI service, which this preview does not have: the log reports it instead. Drag outside the panel to orbit the camera.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AICaptionComponent); if (component) log(component.props);}