s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Scene System
Component
chevron_left
Scene System
class
Component
search
Constructors
lock
Component
Properties
data_object
Active
data_object
Components
data_object
ComponentVersion
data_object
DebugOverlay
data_object
Enabled
data_object
Flags
data_object
GameObject
data_object
Id
data_object
IsProxy
data_object
IsValid
data_object
LocalPosition
data_object
LocalRotation
data_object
LocalScale
data_object
LocalTransform
data_object
Network
data_object
OnComponentDestroy
data_object
OnComponentDisabled
data_object
OnComponentEnabled
data_object
OnComponentFixedUpdate
data_object
OnComponentStart
data_object
OnComponentUpdate
data_object
Scene
data_object
Tags
lock
Task
data_object
Transform
data_object
WorldPosition
data_object
WorldRotation
data_object
WorldScale
data_object
WorldTransform
Methods
lock
__rpc_Wrapper
lock
__sync_GetValue
lock
__sync_SetValue
functions
AddComponent
functions
Deserialize
functions
DeserializeImmediately
functions
Destroy
functions
DestroyGameObject
lock
DrawGizmos
remove_circle
EditLog
functions
GetComponent
functions
GetComponentInChildren
functions
GetComponentInParent
functions
GetComponents
functions
GetComponentsInChildren
functions
GetComponentsInParent
functions
GetOrAddComponent
functions
Invoke
functions
IsRunning
lock
OnAwake
lock
OnDestroy
remove_circle
OnDirty
lock
OnDisabled
lock
OnEnabled
lock
OnFixedUpdate
lock
OnLoad
lock
OnParentChanged
functions
OnParentDestroy
lock
OnPreRender
remove_circle
OnPropertyDirty
lock
OnRefresh
lock
OnStart
lock
OnTagsChanged
lock
OnUpdate
lock
OnValidate
functions
Reset
functions
Run
functions
Serialize
functions
Stop
functions
StopAll
Static Methods
functions
CopyToClipboard
functions
JsonRead
functions
JsonWrite
functions
PasteValues
menu
Component
A GameObject can have many components, which are the building blocks of the game.
class
Sandbox
.
abstract
Sandbox.Engine
build
Constructors
1
Component
(
)
data_object
Properties
29
Active
bool
True if this Component is enabled, and all of its ancestor GameObjects are enabled
Components
ComponentList
Access components on this component's GameObject
ComponentVersion
int
The version of the component. Used by Sandbox.JsonUpgrader.
DebugOverlay
DebugOverlaySystem
Allows drawing of temporary debug shapes and text in the scene
Enabled
bool
The enable state of this Sandbox.Component.
This doesn't tell you whether the component is actually active because its parent Sandbox.GameObject might be disabled. This merely tells you what the component wants to be. You should use Sandbox.Component.Active to determine whether the object is truly active in the scene.
Flags
ComponentFlags
GameObject
GameObject
The GameObject this component belongs to.
Id
Guid
IsProxy
bool
True if this is a networked object and is owned by another client. This means that we're not controlling this object, so shouldn't try to move it or anything.
IsValid
bool
LocalPosition
Vector3
The local position of the game object.
LocalRotation
Rotation
The local rotation of the game object.
LocalScale
Vector3
The local scale of the game object.
LocalTransform
Transform
The local transform of the game object.
Network
NetworkAccessor
OnComponentDestroy
Action
OnComponentDisabled
Action
OnComponentEnabled
Action
OnComponentFixedUpdate
Action
OnComponentStart
Action
OnComponentUpdate
Action
Scene
Scene
The scene this Component is in. This is a shortcut for `GameObject.Scene`.
Tags
ITagSet
Task
TaskSource
Allow creating tasks that are automatically cancelled when the GameObject is destroyed.
Transform
GameTransform
The transform of the GameObject this component belongs to. Components don't have their own transforms but they can access the transform of the GameObject they belong to. This is a shortcut for `GameObject.Transform`.
WorldPosition
Vector3
The world position of the game object.
WorldRotation
Rotation
The world rotation of the game object.
WorldScale
Vector3
The world scale of the game object.
WorldTransform
Transform
The world transform of the game object.
functions
Methods
40
__rpc_Wrapper
(
m
,
argument
)
__sync_GetValue
(
p
)
T
__sync_SetValue
(
p
)
AddComponent
(
startEnabled
)
T
Add a component to this GameObject
Deserialize
(
node
)
DeserializeImmediately
(
node
)
Deserialize this component as per Sandbox.Component.Deserialize(System.Text.Json.Nodes.JsonObject) but update Sandbox.Component.GameObject and Sandbox.Component property references immediately instead of having them deferred.
Destroy
(
)
Destroy this component, if it isn't already destroyed. The component will be removed from its GameObject and will stop existing. You should avoid interating with the component after calling this.
DestroyGameObject
(
)
Destroy the parent GameObject. This really only exists so when you're typing Destroy you realise that calling Destroy only destroys the Component - not the whole GameObject.
DrawGizmos
(
)
Called in the editor to draw things like bounding boxes etc
EditLog
(
name
,
source
)
obsolete
Called when something on the component has been edited
GetComponent
(
includeDisabled
)
T
Get a component on this GameObject
GetComponentInChildren
(
includeDisabled
,
includeSelf
)
T
Get component on this GameObject or on descendant GameObjects
GetComponentInParent
(
includeDisabled
,
includeSelf
)
T
Get component on this GameObject and on ancestor GameObjects
GetComponents
(
includeDisabled
)
IEnumerable`1
Get components on this GameObject
GetComponentsInChildren
(
includeDisabled
,
includeSelf
)
IEnumerable`1
Get components on this GameObject and on descendant GameObjects
GetComponentsInParent
(
includeDisabled
,
includeSelf
)
IEnumerable`1
Get components on this GameObject and on ancestor GameObjects
GetOrAddComponent
(
startEnabled
)
T
Add a component to this GameObject
Invoke
(
secondsDelay
,
action
,
ct
)
Invoke a method in x seconds. Won't be invoked if the component is no longer active.
IsRunning
(
doo
)
bool
Returns true if the given Doo is currently running on this component.
OnAwake
(
)
Called once per component
OnDestroy
(
)
Called once, when the component or gameobject is destroyed
OnDirty
(
)
obsolete
Called when the component has become dirty
OnDisabled
(
)
OnEnabled
(
)
Called after Awake or whenever the component switches to being enabled (because a gameobject hierarchy active change, or the component changed)
OnFixedUpdate
(
)
When enabled, called on a fixed interval that is determined by the Scene. This is also the fixed interval in which the physics are ticked. Time.Delta is that fixed interval.
OnLoad
(
)
Task
OnParentChanged
(
oldParent
,
newParent
)
The parent has changed from one parent to another
OnParentDestroy
(
)
The parent object is being destroyed. This is a nice place to switch to a healthier parent.
OnPreRender
(
)
When enabled, called every frame, does not get called on a dedicated server
OnPropertyDirty
(
p
)
obsolete
OnRefresh
(
)
Called immediately after being refreshed from a network snapshot.
OnStart
(
)
Called once before the first Update - when enabled.
OnTagsChanged
(
)
When tags have been updated
OnUpdate
(
)
When enabled, called every frame
OnValidate
(
)
Called immediately after deserializing, and when a property is changed in the editor.
Reset
(
)
Run
(
doo
,
c
)
Serialize
(
options
)
JsonNode
Stop
(
doo
)
Stop a specific Doo, if it's running
StopAll
(
)
Stop all running Doos
functions
Static Methods
4
CopyToClipboard
(
component
)
Copy the target Sandbox.Component to the clipboard.
JsonRead
(
reader
,
targetType
)
object
JsonWrite
(
value
,
writer
)
PasteValues
(
target
)
Paste component values from clipboard to the target Sandbox.Component.
Inheritance
Component
AmbientLight
AudioListener
BaseChair
BasePostProcess
BasePostProcess<T>
AmbientOcclusion
BlitOverlay
Bloom
Blur
ChromaticAberration
ColorAdjustments
ColorGrading
DepthOfField
FilmGrain
Highlight
MotionBlur
Pixelate
ScreenSpaceReflections
Sharpen
Tonemapping
Vignette
BaseSoundComponent
SoundBoxComponent
SoundPointComponent
BeamEffect
Button
CableComponent
CableNodeComponent
CameraComponent
CharacterController
CitizenAnimationHelper
ClutterComponent
Collider
BoxCollider
CapsuleCollider
HullCollider
MapCollider
MeshComponent
ModelCollider
PlaneCollider
SphereCollider
Terrain
CubemapFog
Decal
Door
Dresser
EnvmapProbe
FireDamage
GradientFog
HammerMesh
HighlightOutline
IndirectLightVolume
Joint
BallJoint
ControlJoint
FixedJoint
HingeJoint
SliderJoint
SpringJoint
UprightJoint
WheelJoint
LegacyParticleSystem
Light
DirectionalLight
PointLight
SpotLight
LipSync
ManualHitbox
MapInstance
MapObjectComponent
MapSkybox3D
MissingComponent
ModelHitboxes
ModelPhysics
MoveMode
MoveModeLadder
MoveModeSwim
MoveModeWalk
SitMoveMode
MoviePlayer
NavMeshAgent
NavMeshLink
NetworkHelper
PanelComponent
ParticleController
ParticleAttractor
ParticleLightRenderer
ParticleModelRenderer
ParticleTrailRenderer
ParticleEffect
ParticleEmitter
ParticleBoxEmitter
ParticleConeEmitter
ParticleModelEmitter
ParticleRingEmitter
ParticleSphereEmitter
PhysicsFilter
PlayerController
PostProcess
Prop
Gib
RadiusDamage
Renderer
DecalRenderer
LineRenderer
ModelRenderer
SkinnedModelRenderer
ParticleRenderer
ParticleSpriteRenderer
ParticleTextRenderer
SpriteRenderer
TextRenderer
TrailRenderer
WorldPanel
Rigidbody
SceneInformation
ScreenPanel
SkyBox2D
SoundscapeTrigger
SpawnPoint
TemporaryEffect
TransformProxyComponent
TriggerHurt
VerletRope
Voice
VolumeComponent
DspVolume
NavMeshArea
PostProcessVolume
VolumetricFogController
VolumetricFogVolume
VRAnchor
VRHand
VRModelRenderer
VRTrackedObject
WorldInput
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.