BaseChair
public class BaseChair : Component Constructors
BaseChair() Properties
| Name | Type | Description |
|---|---|---|
SeatPosition | GameObject | A GameObject representing the seat position |
SitPose | AnimatorSitPose | The sitting pose to use when a player is seated |
SitHeight | Single | Height offset for sitting position, from -1 (lowest) to 1 (highest) |
EyePosition | GameObject | A GameObject representing the eye position |
PitchRange | Vector2 | Pitch range for seated players |
YawRange | Vector2 | Yaw range for seated players |
ExitPoints | GameObject[] | |
IsOccupied | Boolean | Returns true if the chair is currently occupied |
TooltipTitle | String | The title of this chair's tooltip. Empty to disable. |
TooltipIcon | String | The icon for this chair's tooltip. Either Material Icons or an Emoji. |
TooltipDescription | String | A longer description for this chair's tooltip. |
Methods
virtual Boolean CanPress(Event e) Chair is usable if the player can enter
virtual Boolean Press(Event e) Called when the player has pressed to use the chair. Only called if CanPress returned true.
Void Sit(PlayerController player) Called on the client to place the player in the chair.
virtual Void AskToLeave(PlayerController player) Called on the host to request leaving the chair.
virtual Boolean CanLeave(PlayerController player) Return true if this player can leave the chair
Void Eject(PlayerController player) Called on the client to eject the player from the chair.
Vector3 FindBestExitPoint() Returns a position to place the player when they exit the chair. This searches through ExitPoints to find the best one, which is usually the one the player is most facing towards.
virtual Boolean CanEnter(PlayerController player) Return true if this player can enter the chair
virtual Transform GetEyeTransform() Get the transform representing the eye position when seated
PlayerController GetOccupant() Gets the player that is currently occupying the chair
virtual Void UpdatePlayerAnimator(PlayerController controller, SkinnedModelRenderer renderer) Called to update the player's animator when seated
virtual Transform CalculateEyeTransform(PlayerController controller) Calculates the eye transform for a seated player
virtual Tooltip? GetTooltip(Event e)