| title | Interacting with Cameras |
|---|---|
| description | Cameras are specialized Locators optimized to orient a player's screen, and can be used to create cutscenes, custom player perspectives, and more. This page explains how to interact with Cameras in your Rig Instance using commands. |
{ $frontmatter.description }
Runs a command as and at a specific camera's entity.
| Name | Type | Description |
|---|---|---|
name |
String | The name of the camera to run the command as. |
command |
String | The command to run as the camera. |
:::admonition type="info" title="Example"
execute as @e[tag=aj.<export_namespace>.root] run \
function animated_java:<export_namespace>/as_camera \
{name: '<camera_name>', command:'spectate @s @p'}:::