# Sandbox.Component

A GameObject can have many components, which are the building blocks of the game.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Modifiers: abstract

## Properties

- [`Active`](/api/Sandbox.Component/Active): True if this Component is enabled, and all of its ancestor GameObjects are enabled
- [`Components`](/api/Sandbox.Component/Components): Access components on this component's GameObject
- [`ComponentVersion`](/api/Sandbox.Component/ComponentVersion): The version of the component. Used by `T:Sandbox.JsonUpgrader`.
- [`DebugOverlay`](/api/Sandbox.Component/DebugOverlay): Allows drawing of temporary debug shapes and text in the scene
- [`Enabled`](/api/Sandbox.Component/Enabled): The enable state of this [Sandbox.Component](/api/Sandbox.Component). This doesn't tell you whether the component is actually active because its parent [Sandbox.GameObject](/api/Sandbox.GameObject) might be disabled. This merely tells you what the component wants to be. You should use [Sandbox.Component.Active](/api/Sandbox.Component/Active) to determine whether the object is truly active in the scene.
- [`Flags`](/api/Sandbox.Component/Flags)
- [`GameObject`](/api/Sandbox.Component/GameObject): The GameObject this component belongs to.
- [`Id`](/api/Sandbox.Component/Id)
- [`IsProxy`](/api/Sandbox.Component/IsProxy): 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`](/api/Sandbox.Component/IsValid)
- [`LocalPosition`](/api/Sandbox.Component/LocalPosition): The local position of the game object.
- [`LocalRotation`](/api/Sandbox.Component/LocalRotation): The local rotation of the game object.
- [`LocalScale`](/api/Sandbox.Component/LocalScale): The local scale of the game object.
- [`LocalTransform`](/api/Sandbox.Component/LocalTransform): The local transform of the game object.
- [`Network`](/api/Sandbox.Component/Network)
- [`OnComponentDestroy`](/api/Sandbox.Component/OnComponentDestroy)
- [`OnComponentDisabled`](/api/Sandbox.Component/OnComponentDisabled)
- [`OnComponentEnabled`](/api/Sandbox.Component/OnComponentEnabled)
- [`OnComponentFixedUpdate`](/api/Sandbox.Component/OnComponentFixedUpdate)
- [`OnComponentStart`](/api/Sandbox.Component/OnComponentStart)
- [`OnComponentUpdate`](/api/Sandbox.Component/OnComponentUpdate)
- [`Scene`](/api/Sandbox.Component/Scene): The scene this Component is in. This is a shortcut for `GameObject.Scene`.
- [`Tags`](/api/Sandbox.Component/Tags)
- [`Transform`](/api/Sandbox.Component/Transform): 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`](/api/Sandbox.Component/WorldPosition): The world position of the game object.
- [`WorldRotation`](/api/Sandbox.Component/WorldRotation): The world rotation of the game object.
- [`WorldScale`](/api/Sandbox.Component/WorldScale): The world scale of the game object.
- [`WorldTransform`](/api/Sandbox.Component/WorldTransform): The world transform of the game object.

## Methods

- [`AddComponent`](/api/Sandbox.Component/AddComponent): Add a component to this GameObject
- [`CopyToClipboard`](/api/Sandbox.SceneExtensions/CopyToClipboard): Copy the target [Sandbox.Component](/api/Sandbox.Component) to the clipboard.
- [`Deserialize`](/api/Sandbox.Component/Deserialize)
- [`DeserializeImmediately`](/api/Sandbox.Component/DeserializeImmediately): Deserialize this component as per [Sandbox.Component.Deserialize](/api/Sandbox.Component/Deserialize) but update [Sandbox.Component.GameObject](/api/Sandbox.Component/GameObject) and [Sandbox.Component](/api/Sandbox.Component) property references immediately instead of having them deferred.
- [`Destroy`](/api/Sandbox.Component/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`](/api/Sandbox.Component/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.
- [`EditLog`](/api/Sandbox.Component/EditLog): Called when something on the component has been edited
- [`GetComponent`](/api/Sandbox.Component/GetComponent): Get a component on this GameObject
- [`GetComponentInChildren`](/api/Sandbox.Component/GetComponentInChildren): Get component on this GameObject or on descendant GameObjects
- [`GetComponentInParent`](/api/Sandbox.Component/GetComponentInParent): Get component on this GameObject and on ancestor GameObjects
- [`GetComponents`](/api/Sandbox.Component/GetComponents): Get components on this GameObject
- [`GetComponentsInChildren`](/api/Sandbox.Component/GetComponentsInChildren): Get components on this GameObject and on descendant GameObjects
- [`GetComponentsInParent`](/api/Sandbox.Component/GetComponentsInParent): Get components on this GameObject and on ancestor GameObjects
- [`GetOrAddComponent`](/api/Sandbox.Component/GetOrAddComponent): Add a component to this GameObject
- [`Invoke`](/api/Sandbox.Component/Invoke): Invoke a method in x seconds. Won't be invoked if the component is no longer active.
- [`IsRunning`](/api/Sandbox.ComponentDooExtensions/IsRunning)
- [`IsRunningDoo`](/api/Sandbox.Component/IsRunningDoo): Returns true if the given Doo is currently running on this component.
- [`JsonRead`](/api/Sandbox.Component/JsonRead)
- [`JsonWrite`](/api/Sandbox.Component/JsonWrite)
- [`OnParentDestroy`](/api/Sandbox.Component/OnParentDestroy): The parent object is being destroyed. This is a nice place to switch to a healthier parent.
- [`PasteValues`](/api/Sandbox.SceneExtensions/PasteValues): Paste component values from clipboard to the target [Sandbox.Component](/api/Sandbox.Component).
- [`Reset`](/api/Sandbox.Component/Reset)
- [`Run`](/api/Sandbox.ComponentDooExtensions/Run)
- [`RunDoo`](/api/Sandbox.Component/RunDoo)
- [`Serialize`](/api/Sandbox.Component/Serialize)
- [`Stop`](/api/Sandbox.ComponentDooExtensions/Stop)
- [`StopAll`](/api/Sandbox.ComponentDooExtensions/StopAll)
- [`StopAllDoo`](/api/Sandbox.Component/StopAllDoo): Stop all running Doos
- [`StopDoo`](/api/Sandbox.Component/StopDoo): Stop a specific Doo, if it's running
