Log inGet started
World

Save Point

Branchmain
Branchesmain
Commit8937fc8d08

README.md

Seat

A place to sit. Put it on an empty entity standing where a sitter's hips go (on the seat surface, back from the front edge), turned so its +Z points the way the sitter faces. The player's body needs the engine's humanoid avatar (any rig with humanoid roles); nothing else is needed on the seat. room.Sofa carries three (seat_1..3), room.DeskChair one (seat).

  • Near a free seat with empty hands, it offers "Sit" to stations.focus; the focus picker chooses by aim between it, the seats beside it and any prop in reach (the nearest when nothing is aimed at), and Interact sits you only when this seat is the target. room.Bed carries two on its foot (bed_seat_1..2).
  • Seated: the body is held on the seat facing its +Z, walking and gravity are off, and the body takes a seated pose made from its own rig (seating.pose: thighs forward, shins down, hands in the lap). The camera eases into a view over your shoulder (the engine's mount camera on the seat), and back to your walking view when you stand.
  • Stand up: Interact (with nothing in reach to pick up), Jump, or a push of Move. You stand at standOffset, clear of the furniture.
  • Pick up a controller or the Game Boy while seated and it plays as usual (its own view and controls take over until you put it down); doing so awards the seated progress event once.
  • Multiplayer: the sitter's peer sends seating.hold (on sitting and every 2 s, so a late joiner hears it) and seating.free; every peer poses that body seated on its own copy and refuses the seat to anyone else. Two players sitting at the same instant are settled by who sat first. A seat whose sitter stops being heard for 7 s, or whose body leaves, frees itself.

Fields: label, promptRange (0.9), style (ride | drive), hipLift (0.1), standOffset, viewOffset, viewPitch, facing (world facing, kept up to date), status (who sits, for inspection).

Methods: seat:occupant() (the avatar sitting, or nil), seat:isSeatedLocal(). Across all seats, require("seating.seats"): isSeatedLocal(), localSeat(), seatOf(avatar), occupantOf(seatId), all().