Seat

Show Deprecated

A type of BasePart that a player character can 'sit' in. When a character touches an enabled Seat object, it will be attached to the part by a Weld and the default character scripts will play a sitting animation.

How do Seats work?

When a model containing a Humanoid and a BasePart called 'HumanoidRootPart' (generally a player character) touches a seat, a Weld is created between the seat and the part. The C0 and C1 properties are configured so that the character is welded 2 studs above the seat. This weld is named 'SeatWeld' and parented to the seat.

When sitting the Seat.Occupant property is set to the Humanoid that is 'sitting' in the seat. Furthermore the Humanoid.SeatPart property of the humanoid is set to the seat.

A character can also be forced to sit in a seat using the Seat:Sit() function.

There are two ways for a character to get out of a seat. When a player jumps, they are removed from the seat. However this can also be done manually by destroying the seat weld, for example:


1seat:FindFirstChild("SeatWeld"):Destroy()
2

Note seats have a cooldown (currently 3 seconds) that is on a per-character per-seat basis. This means once a character has gotten out of a seat they cannot sit back on the same seat for 3 seconds. This cooldown behavior may change and should not be relied upon by developers.

What can Seats be used for?

Seats have a diverse range of uses, ranging from the obvious to the more unconventional.

  • Creating chairs or benches without the need for any programming
  • Allowing characters to 'sit' in moving objects such as vehicles without getting flung around
  • Creating interfaces that are controlled by the character in the seat using the Seat.Occupant property

Code Samples

Detecting Seat Occupant

1local Players = game:GetService("Players")
2
3local seat = Instance.new("Seat")
4seat.Anchored = true
5seat.Position = Vector3.new(0, 1, 0)
6seat.Parent = workspace
7
8local currentPlayer = nil
9
10local function onOccupantChanged()
11 local humanoid = seat.Occupant
12 if humanoid then
13 local character = humanoid.Parent
14 local player = Players:GetPlayerFromCharacter(character)
15 if player then
16 print(player.Name .. " has sat down")
17 currentPlayer = player
18 return
19 end
20 end
21 if currentPlayer then
22 print(currentPlayer.Name .. " has got up")
23 currentPlayer = nil
24 end
25end
26
27seat:GetPropertyChangedSignal("Occupant"):Connect(onOccupantChanged)

Summary

Properties

Whether or not the seat is usable. If set to true, the seat will act as a normal part.

The humanoid that is sitting in the seat.

READ ONLY
NOT REPLICATED

Events

Methods

Sit(humanoid: Instance): void  

Forces the character with the specified Humanoid to sit in the Seat.

Properties

Disabled

Whether or not the seat is usable. If set to true, the seat will act as a normal part.

Occupant

Read Only
Not Replicated

The humanoid that is sitting in the seat

Events

Methods

Sit

void

Forces the character with the specified Humanoid to sit in the Seat.

Parameters

humanoid: Instance

Returns

void