mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
131 lines
4 KiB
YAML
131 lines
4 KiB
YAML
# This file is automatically generated. Please don't edit it manually.
|
|
# To submit a bug report on the content, see
|
|
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
|
|
|
|
name: Seat
|
|
type: class
|
|
memory_category: BaseParts
|
|
summary: |
|
|
A type of `Class.BasePart` that characters can 'sit' in. When a character
|
|
touches an enabled Seat object, it will be attached to the part by a
|
|
`Class.Weld` and the default character scripts will play a sitting animation.
|
|
description: |
|
|
A type of `Class.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
|
|
`Class.Weld` and the default character scripts will play a sitting animation.
|
|
|
|
## How do Seats work?
|
|
|
|
When a model containing a `Class.Humanoid` and a `Class.BasePart` called
|
|
'HumanoidRootPart' (generally a player character) touches a seat, a
|
|
`Class.Weld` is created between the seat and the part. The
|
|
`Class.JointInstance.C0|C0` and `Class.JointInstance.C1|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 `Class.Seat.Occupant` property is set to the `Class.Humanoid`
|
|
that is 'sitting' in the seat. Furthermore the `Class.Humanoid.SeatPart`
|
|
property of the humanoid is set to the seat.
|
|
|
|
A character can also be forced to sit in a seat using the `Class.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:
|
|
|
|
seat:FindFirstChild("SeatWeld"):Destroy()
|
|
|
|
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 `Class.Seat.Occupant` property
|
|
code_samples:
|
|
- Seat-Occupant
|
|
inherits:
|
|
- Part
|
|
descendants: []
|
|
tags: []
|
|
deprecation_message: ''
|
|
properties:
|
|
- name: Seat.Disabled
|
|
summary: |
|
|
Whether or not the seat is usable. If set to true, the seat will act as a
|
|
normal part.
|
|
description: |
|
|
Whether or not the seat is usable. If set to true, the seat will act as a
|
|
normal part.
|
|
code_samples: []
|
|
type: boolean
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Control
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Basic
|
|
- Avatar
|
|
- name: Seat.Occupant
|
|
summary: |
|
|
The humanoid that is sitting in the seat.
|
|
description: |
|
|
The humanoid that is sitting in the seat
|
|
code_samples: []
|
|
type: Humanoid
|
|
tags:
|
|
- ReadOnly
|
|
- NotReplicated
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Control
|
|
serialization:
|
|
can_load: false
|
|
can_save: false
|
|
capabilities:
|
|
- Basic
|
|
- Avatar
|
|
methods:
|
|
- name: Seat:Sit
|
|
summary: |
|
|
Forces the character with the specified `Class.Humanoid` to sit in the
|
|
Seat.
|
|
description: |
|
|
Forces the character with the specified `Class.Humanoid` to sit in the
|
|
Seat.
|
|
code_samples: []
|
|
parameters:
|
|
- name: humanoid
|
|
type: Instance
|
|
default:
|
|
summary: ''
|
|
returns:
|
|
- type: ()
|
|
summary: ''
|
|
tags: []
|
|
deprecation_message: ''
|
|
security: None
|
|
thread_safety: Unsafe
|
|
capabilities:
|
|
- Basic
|
|
- Avatar
|
|
events: []
|
|
callbacks: []
|