Recipes
Camera modes top-down isometric side-scroller and switching
The game is overhead, isometric, side-on, or swaps camera angles between scenes. Every camera mode is a
CameraComponent on its own camera entity, tuned by projection, angle, and follow. Switching is a priority change, not a setCamera call (that is Spawn vocabulary).engine v1.0.234since component-field-contract ecs.component-field-contract.v1, action-catalog.v1.0.232, camera.v1, mutation.v1Copy for LLM
Use this for
a top-down or overhead camera; a fixed-angle isometric view; a 2d side-scroller camera; an orthographic camera; switching between multiple cameras at runtime
Not for
first-person mouselook (see first-person-controls); a third-person follow rig behind the avatar (see third-person-and-platformer-movement); grading and lens feel (see camera-feel)
Pairs with: Camera feel field of view smoothing tone mapping and post, First-person camera movement and mouselook controls, Third-person follow camera and platformer jump movement, Pointer click and tap to world cursor interaction
The recipe
The camera lives on a separate entity from the avatar (see third-person-and-platformer-movement); tune fields with project_add_component carrying the full { "type":"CameraComponent", ... } value.
- Top-down (3d overhead): place the camera entity above the play area, rotate its
TransformComponentto look straight down, setfollowEntityIdto the avatar and a highfollowOffset{ "x":0, "y":20, "z":0 }. Keepprojection:"perspective"for depth. - Orthographic top-down or isometric: set
projection:"orthographic"andorthoSizefor the zoom; for isometric, rotate the camera entity to the fixed iso angle (for example yaw 45, pitch 30) and keep it there. - Side-scroller (2d): put the camera to the side with
projection:"orthographic"(or a narrowfovperspective), setfollowEntityIdto the avatar, and zero the follow on the locked axis viafollowOffsetso it tracks only horizontal and vertical. - Runtime switching: give each camera a
CameraComponentwithactive:trueand a distinctpriority. The highest-priority active camera is used in Play. To cut to another camera from a script,ctx.entity.patchComponentthe target camera to a higherpriority(or flipactive) in a GessaScript body. - Follow feel per mode: tune
followSmoothing(0 to 1) so an overhead camera glides and a side-scroller stays tight; addlookAtEntityIdto keep the avatar centered.
Pitfalls
- Two
activecameras at the SAMEpriorityare ambiguous; give the intended camera a strictly higher priority. orthoSizeonly applies whenprojection:"orthographic"; setting it on a perspective camera does nothing.- A top-down or isometric camera still needs the entity rotated to the view angle; projection alone does not tilt the view.
- Switching by priority is instant. For a smooth move between viewpoints, animate one camera's transform rather than snapping priorities.
Verify
qa_capture_renderer_viewport(qa.renderer.viewport.capture) to confirm the framing and angle read for each mode.project_get_graph_snapshotto confirm which camera is highest-priority active.