Skip to main content
Version: 0.14.0

Mounts and Seats

A mount is any item an agent occupies rather than merely stands next to — a chair, a bench, a cart, a horse. The item carries a Mount component, and each place an agent can occupy is a Seat beneath it.

Mounts are what the Mount and Dismount behaviour actions operate on. See Behaviour Actions for the actions themselves.

The short version

  1. Select your item and add the Mount component.
  2. Set Mount Transform to the root object of the thing that moves.
  3. Under Seats, press +. A child named Seat appears at the mount's position.
  4. Move the seat to where the agent should end up sitting.

That is a working mount. Everything below is refinement.

The Mount component

FieldWhat it does
Mount TransformThe root (highest parent) transform of the mount. Movement is applied here, not to the seated agent
SeatsThe list of seats beneath this mount

Leave Mount Transform empty and the Mount component's own transform is used. Set it explicitly whenever the component sits on a child of the thing that actually moves — a cart whose Mount lives on a body object still has to drive the cart root.

Seats are found by searching the mount's children, at any depth, so a seat parented under a cart's bench object is picked up like one parented directly. The list is rebuilt every time the inspector is drawn, so seats you add or reparent by hand appear without any further action.

The + button creates a child GameObject named Seat at the mount's own position, with a SeatService already on it. The - button destroys the selected seat object outright.

note

New seats are created as control points. On a bench or a row of passenger places, turn Control Point off for every seat that should not drive.

The list is reorderable, and the order is meaningful — see How a seat is chosen.

The Seat component

Each row in the mount's seat list is a Seat object with its own inspector.

FieldWhat it does
Distance ToleranceHow close the agent must get before it is placed into the seat. Leave at 0 to use the ordinary arrival check instead
Control PointWhether an agent in this seat drives the mount
Transition StyleBLEND or SNAP — how the agent travels from the mount location to the seat while the animation plays
Transition Lead InSeconds to hold still at the start of a blended transition, covering the animator's crossfade. Defaults to 0.25
Mount LocationWhere the agent walks to before mounting. Falls back to the seat itself
Dismount LocationWhere the agent is placed when it gets out. Falls back to the mount location, and then to the seat
Mount AnimationPlayed at the mount location before the agent takes the seat. Leave empty to sit immediately on arrival
Dismount AnimationPlayed from the seat before the agent is put back on its feet. Leave empty to stand immediately

Mount Location and Dismount Location each have a button that creates the object if it does not exist yet, and selects and frames it if it does. Both are created as children of the seat, at the seat's position, so the first thing to do after creating one is move it somewhere an agent can actually stand.

The mount and dismount animations are authored with the same endpoint widget the item's Action POIs use, so a getting-in animation is set up exactly like a use animation.

Reading the scene gizmos

Select a seat and it draws itself:

ColourShapeWhat it marks
BlueSphereThe seat — where the agent ends up
BlueWireframeThe distance tolerance, drawn around the approach point
RedSphereThe mount location
GreenSphereThe dismount location

The tolerance sphere is centred on the mount location where one is authored, not on the seat, because the mount location is the point the agent actually walks to.

How a seat is chosen

When a Mount action runs, the agent asks the mount to reserve it a seat.

  1. A free control point wins outright, however far away it is. A cart with nobody at the controls goes nowhere, so filling the driving seat is worth a longer walk than taking the nearest bench space and stranding the cart. Control points are considered in the order they appear in the mount's seat list, so the same seat is the driver's every time.
  2. Otherwise the nearest free seat wins, measured by its mount location rather than by the seat. On a cart the seats sit together while their mount locations are spread down its sides, and the walk is what the agent pays for.

A seat is reserved the moment it is chosen, and stays reserved for the whole walk over. Without that, every agent heading for the same bench picks the same free seat and they race for it on arrival. The claim is given up when the agent sits down, and again when it dismounts.

An agent that asks twice gets the seat it already holds, so a Mount action that spans several ticks does not wander between seats.

If every seat is taken the action simply fails, and the agent goes and finds something else to do.

Mounting and dismounting

Once the agent is within tolerance of the mount location:

  1. It turns to match the seat's heading.
  2. The Mount Animation plays.
  3. The agent is parented to the seat and zeroed against it, so a passenger on a moving cart stays in place and faces forward as the cart moves under it.

Dismounting runs the same way in reverse, minus the turn — by then the agent is parented to the seat, and turning it would spin the seated character in its chair.

Transition style

The right choice depends on the clip.

BLEND carries the agent from where it is standing to the seat over the length of the animation. This is what a mocap transition clip needs: a clip like Stand_Trans_SitChair carries its movement as root motion, and an agent driven by the nav mesh generally has Apply Root Motion switched off, so that displacement is discarded and the agent performs the whole sit on the spot. BLEND puts the movement back.

SNAP leaves the agent where it stands and places it at the end. Use it for a clip authored in place.

Transition lead in

A blended transition holds still for Transition Lead In seconds before it starts moving, to cover the animator crossfading into the clip. Match it to the transition duration into the Dynamic states on your agent controller — the shipped controller uses 0.25, which is also the default.

Set it too low and the agent starts sliding toward the seat before it has visibly begun to move, landing in the seat early.

Common problems

SymptomCause
Agent stands beside the seat foreverIts mount location is somewhere it cannot reach, or the tolerance is too small for it to satisfy
Agent performs the whole sit on the spot, then pops into the seatTransition style is SNAP on a mocap clip that moves. Use BLEND
Agent slides into the seat before the animation startsTransition lead in is lower than the animator's crossfade into its Dynamic states
Agent is shoved out backwards on dismountNo dismount location, and the mount location it falls back to is off the nav mesh
Every agent walks to the same seatSeats are being read directly rather than reserved. Reservation is what the Mount action does for you
The cart never moves with a driver aboardNo seat on it has Control Point enabled
Mount action does nothing and warns in the consoleThe matched item has no Mount component on it

Next step

Continue to Agent Inventory, or see Behaviour Actions for the Mount, Dismount and Await for Mount to be Filled actions that drive all of this.