AI Translation
Updated
Allowed visitor-local output languages, in fallback order.
- Type
comp-ai-translation- Script class
AITranslatorComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Translation and memory: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Cycle the output languagePressing L steps an AI agent's output language through the languages its AI Translation allows, then back to the original, and logs each change from subscribeOutputLanguage.
Click the scene, then press L to change the language. The dialog's language button follows. Translating replies needs the AI service; choosing the language does not.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AITranslatorComponent); if (component) log(component.props);}