Summary

A GameObject can have many components, which are the building blocks of the game.

Properties

Active True if this Component is enabled, and all of its ancestor GameObjects are enabled
Components Access components on this component's GameObject
ComponentVersion The version of the component. Used by Sandbox.JsonUpgrader.
DebugOverlay Allows drawing of temporary debug shapes and text in the scene
Enabled <para> The enable state of this Sandbox.Component. </para><para> 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. </para>
Flags
GameObject The GameObject this component belongs to.
Id
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
LocalPosition The local position of the game object.
LocalRotation The local rotation of the game object.
LocalScale The local scale of the game object.
LocalTransform The local transform of the game object.
Network
OnComponentDestroy
OnComponentDisabled
OnComponentEnabled
OnComponentFixedUpdate
OnComponentStart
OnComponentUpdate
Scene The scene this Component is in. This is a shortcut for `GameObject.Scene`.
Tags
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 The world position of the game object.
WorldRotation The world rotation of the game object.
WorldScale The world scale of the game object.
WorldTransform The world transform of the game object.

Methods

AddComponent
Deserialize
DeserializeImmediately
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.
EditLog
GetComponent
GetComponentInChildren
GetComponentInParent
GetComponents
GetComponentsInChildren
GetComponentsInParent
GetOrAddComponent
Invoke
Reset
Serialize

Static Methods

JsonRead
JsonWrite
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.