s&box docs

public class Sandbox.BaseChair : Sandbox.Component

Constructors

Showing 1 constructors

Methods

Showing 15 methods

public virtual sealed void AskToLeave(Sandbox.PlayerController player)

Called on the host to request leaving the chair.

public virtual Transform CalculateEyeTransform(Sandbox.PlayerController controller)

Calculates the eye transform for a seated player

public virtual bool CanEnter(Sandbox.PlayerController player)

Return true if this player can enter the chair

public virtual bool CanLeave(Sandbox.PlayerController player)

Return true if this player can leave the chair

protected void ClampEyes(Sandbox.PlayerController controller)

Clamps the eye angles of a seated player between the PitchRange and YawRange

protected virtual void DrawGizmos()

Draws the player model sitting in the chair if it's selected

public void Eject(Sandbox.PlayerController player)

Called on the client to eject the player from the chair.

public 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.

public virtual Transform GetEyeTransform()

Get the transform representing the eye position when seated

public Sandbox.PlayerController GetOccupant()

Gets the player that is currently occupying the chair

public virtual sealed bool Press(Sandbox.Component.IPressable.Event e)

Called when the player has pressed to use the chair. Only called if CanPress returned true.

public void Sit(Sandbox.PlayerController player)

Called on the client to place the player in the chair.

Properties

Showing 11 properties

public Sandbox.GameObject Sandbox.BaseChair.EyePosition { get; set; }

A GameObject representing the eye position

public bool Sandbox.BaseChair.IsOccupied { get; set; }

Returns true if the chair is currently occupied

public Vector2 Sandbox.BaseChair.PitchRange { get; set; }

Pitch range for seated players

public Sandbox.GameObject Sandbox.BaseChair.SeatPosition { get; set; }

A GameObject representing the seat position

public float Sandbox.BaseChair.SitHeight { get; set; }

Height offset for sitting position, from -1 (lowest) to 1 (highest)

public string Sandbox.BaseChair.TooltipDescription { get; set; }

A longer description for this chair's tooltip.

public string Sandbox.BaseChair.TooltipIcon { get; set; }

The icon for this chair's tooltip. Either Material Icons or an Emoji.

public string Sandbox.BaseChair.TooltipTitle { get; set; }

The title of this chair's tooltip. Empty to disable.

public Vector2 Sandbox.BaseChair.YawRange { get; set; }

Yaw range for seated players

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.BaseChair

On this page

Constructorspublic BaseChair()Methodspublic virtual sealed System.Void AskToLeave(Sandbox.PlayerController player)public virtual Transform CalculateEyeTransform(Sandbox.PlayerController controller)public virtual System.Boolean CanEnter(Sandbox.PlayerController player)public virtual System.Boolean CanLeave(Sandbox.PlayerController player)public virtual sealed System.Boolean CanPress(Sandbox.Component.IPressable.Event e)protected System.Void ClampEyes(Sandbox.PlayerController controller)protected virtual System.Void DrawGizmos()public System.Void Eject(Sandbox.PlayerController player)public Vector3 FindBestExitPoint()public virtual Transform GetEyeTransform()public Sandbox.PlayerController GetOccupant()public virtual System.Nullable`1<Sandbox.Component.IPressable.Tooltip> GetTooltip(Sandbox.Component.IPressable.Event e)public virtual sealed System.Boolean Press(Sandbox.Component.IPressable.Event e)public System.Void Sit(Sandbox.PlayerController player)public virtual System.Void UpdatePlayerAnimator(Sandbox.PlayerController controller, Sandbox.SkinnedModelRenderer renderer)Propertiespublic Sandbox.GameObject[] Sandbox.BaseChair.ExitPoints { get; set; }public Sandbox.GameObject Sandbox.BaseChair.EyePosition { get; set; }public System.Boolean Sandbox.BaseChair.IsOccupied { get; set; }public Vector2 Sandbox.BaseChair.PitchRange { get; set; }public Sandbox.GameObject Sandbox.BaseChair.SeatPosition { get; set; }public System.Single Sandbox.BaseChair.SitHeight { get; set; }public Sandbox.BaseChair.AnimatorSitPose Sandbox.BaseChair.SitPose { get; set; }public System.String Sandbox.BaseChair.TooltipDescription { get; set; }public System.String Sandbox.BaseChair.TooltipIcon { get; set; }public System.String Sandbox.BaseChair.TooltipTitle { get; set; }public Vector2 Sandbox.BaseChair.YawRange { get; set; }Metadata