cameraRigs.package
- .metadata71 B
- README.md2.3 KB
- birds_eye.component
- camera_rig.module
- chase.component
- cinematic.component
- documentation
- first_person.component
- inputMaps
- isometric.component
- menu.component
- mount.component
- orbit.component
- orbital_follow.component
- package.yaml32 B
- rts.component
- side_scroller.component
- tests
- third_person_follow.component
This package holds more than this page lists. See all of its files in its world.
README.md
cameraRigs
In a world that installs the Controllers library (
world.installLibrary({ world = "034d26cf-dc3d-4123-abad-3944f97c6a60", as = "controllers" })), every package name on this page is written with@controllers::in front of it, andasset.list("component")lists each one under that name.
Camera behaviors for games: a Camera names one in its behavior field and
the behavior moves and turns the camera every frame. Each carries the
cameraBehavior tag, so layers.active.camera.behaviors lists it once the
package is installed, and orbital_follow carries playerDefault, which makes
it the camera a default player is authored with.
| Behavior | What it does |
|---|---|
orbital_follow | Orbits the player on three rings (low, middle, high); look turns it, the wheel zooms, and it pulls in past walls. |
third_person_follow | An over-the-shoulder camera that sits behind the player and turns back behind them while they walk. |
first_person | The camera at the player's eyes; seats in a FirstPersonBody. |
chase | Trails a moving body from behind and above: a car, a boat, a runner. |
mount | Rides a seat on a body: a cockpit, a hood, a turret sight. |
rts | A strategy camera that pans, rotates and zooms over a map. |
isometric | A fixed-angle isometric camera that pans and follows. |
birds_eye | Looks straight down from overhead. |
orbit | Orbits a point or an entity under the look and zoom controls. |
side_scroller | Holds a 2.5D side view on a target. |
cinematic | Plays a cutscene path. |
menu | Holds the camera's authored pose. |
camera_rig is the module the follow cameras share (follow, trail, pull-in,
fades, recentring). The cameraRig input map binds move, look and zoom for the
rts, isometric, birds_eye, orbit, chase and mount behaviors; the
follow cameras read @builtin::inputMaps.default.
local cam = entity.spawn("cam")
cam.component.add("Camera", { behavior = asset.ref("cameraRigs.chase", "component") })
cam.component.get("cameraRigs.chase").target = car.id
documentation/choosing-a-camera says which behavior fits which game and the
fields each one reads. Every behavior runs looks through the player's own camera
settings (@builtin::modules.api.engine.camera_settings).