public class Sandbox.DamageInfo
Describes the damage that should be done to something. This is purposefully a class so it can be derived from, allowing games to create their own special types of damage, while not having to create a whole new system.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 3 constructors
No results match this filter.
Properties
Showing 9 properties
public Sandbox.GameObject Sandbox.DamageInfo.Attacker { get; set; }
Usually a player or Npc
public float Sandbox.DamageInfo.Damage { get; set; }
Amount of damage this should do
public Sandbox.Hitbox Sandbox.DamageInfo.Hitbox { get; set; }
The hitbox that we hit (if any)
public bool Sandbox.DamageInfo.IsExplosion { get; set; }Obsolete
True if this is explosive damage
Obsolete: Use Tags
public Vector3 Sandbox.DamageInfo.Origin { get; set; }
The origin of the damage. For bullets this would be the shooter's eye position. For explosions, this would be the center of the exposion.
public Vector3 Sandbox.DamageInfo.Position { get; set; }
The location of the damage on the hit object.
public Sandbox.PhysicsShape Sandbox.DamageInfo.Shape { get; set; }
The physics shape that we hit (if any)
public Sandbox.TagSet Sandbox.DamageInfo.Tags { get; set; }
Tags for this damage, allows you to enter and read different damage types etc
public Sandbox.GameObject Sandbox.DamageInfo.Weapon { get; set; }
The weapon that did the damage, or a vehicle etc
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.DamageInfo |