cameraRig.inputMap
README.md
cameraRig.inputMap
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.
The controls a camera rig reads: move, look and zoom for a camera the
player nudges while the cursor stays theirs: an isometric or top-down view,
a strategy camera, an orbit rig.
| Control | Keyboard + mouse | Gamepad | Touch |
|---|---|---|---|
move | WASD | Left stick | Left stick |
look | Mouse, while the right button is held | Right stick | Drag the right zone |
zoom | Scroll wheel | Shoulders | Pinch |
The player clicks in the world these cameras show, so the cursor stays where
it is for the whole session and aiming reads a right-button drag.
@builtin::inputMaps.default is the scheme for a camera the player aims with
their whole view. It takes the cursor, and mouse movement steers on its own.
look's right button is read as free: a world that binds the right button
to an action of its own gets that action from a right-drag, and this camera
keeps look on the pad stick and the touch zone.
The group is camera, which composes with whatever a world has live: a
vehicle that stands the player group down leaves the camera those controls
are watched through where it is.
entity.find("cam").component.add("cameraRigs.isometric", { target = "player" })
Every camera behaviour that reads this map takes an inputMap field, so a
world points one at its own map without touching the behaviour.