Propclass

A prop is defined by its model. The model can define its health and what happens when it breaks. This component is designed to be easy to use - since you only need to define the model. Although you can access the procedural (hidden) components, they aren't saved, so it's a waste of time.

object→Component→Prop
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.Prop : Sandbox.Component

Constructors1

Showing 1 constructors

public Prop()PUBLICCONSTRUCTOR

Methods7

Showing 7 methods

public void Break()PUBLIC

Delete this component and split into the procedural components that this prop created.

Returns:void—

public void CreateExplosion()PUBLIC

Returns:void—

public System.Collections.Generic.List`1<Sandbox.Gib> CreateGibs(bool wasImpact = False)PUBLIC

Create the gibs and return them.

ParameterTypeDescription
wasImpact = Falsebool—
Returns:List<Gib>—

public void Ignite()PUBLIC

Returns:void—

public void Kill(Sandbox.DamageInfo damage = null)PUBLIC

ParameterTypeDescription
damage = nullDamageInfo—
Returns:void—

public void NetworkCreateGibs(bool wasImpact = False)PUBLIC

Create the gibs for this prop breaking, over the network. This causes clients to spawn the gibs too.

ParameterTypeDescription
wasImpact = Falsebool—
Returns:void—

public void OnDamage(Sandbox.DamageInfo damage)PUBLIC

ParameterTypeDescription
damageDamageInfo—
Returns:void—

Properties16

Showing 16 properties

public ulong Sandbox.Prop.BodyGroups { get; set; }PUBLICGETSET

Returns:ulong—

protected bool Sandbox.Prop.HasBodyGroups { get; set; }PROTECTEDGETSET

Returns:bool—

protected bool Sandbox.Prop.HasMaterialGroups { get; set; }PROTECTEDGETSET

Returns:bool—

public float Sandbox.Prop.Health { get; set; }PUBLICGETSET

Returns:float—

public bool Sandbox.Prop.IsExplosive { get; set; }PUBLICGETSET

True if this prop will explode when destroyed.

Returns:bool—

public bool Sandbox.Prop.IsFlammable { get; set; }PUBLICGETSET

True if this prop can be set on fire.

Returns:bool—

public bool Sandbox.Prop.IsOnFire { get; set; }PUBLICGETSET

Returns:bool—

public bool Sandbox.Prop.IsStatic { get; set; }PUBLICGETSET

If the prop is static - it won't have dynamic physics. This is usually used for things that you want to be breakable but don't move. Like fences and stuff.

Returns:bool—

public string Sandbox.Prop.MaterialGroup { get; set; }PUBLICGETSET

Returns:string—

public System.Action`1<System.Collections.Generic.List`1<Sandbox.Gib>> Sandbox.Prop.OnGibsCreated { get; set; }PUBLICGETSET

Returns:Action<List<Gib>>—

public System.Action Sandbox.Prop.OnPropBreak { get; set; }PUBLICGETSET

Returns:Action—

public System.Action`1<Sandbox.DamageInfo> Sandbox.Prop.OnPropTakeDamage { get; set; }PUBLICGETSET

Returns:Action<DamageInfo>—

public bool Sandbox.Prop.StartAsleep { get; set; }PUBLICGETSET

Physics will be asleep until it's woken up.

Returns:bool—

public Color Sandbox.Prop.Tint { get; set; }PUBLICGETSET

Returns:Color—

On this page