class DamageInfo

in global :: Sandbox

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.


public GameObject Attacker { get; set; }

Usually a player or Npc

public GameObject Weapon { get; set; }

The weapon that did the damage, or a vehicle etc

public Hitbox Hitbox { get; set; }

The hitbox that we hit (if any)

public float Damage { get; set; }

Amount of damage this should do

public Vector3 Position { get; set; }

The location of the damage

public PhysicsShape Shape { get; set; }

The physics shape that we hit (if any)

public TagSet Tags { get; set; }

Tags for this damage, allows you to enter and read different damage types etc

public bool IsExplosion { get; set; }

True if this is explosive damage

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public DamageInfo( )

😔 No documentation found.

public DamageInfo( float damage, GameObject attacker, GameObject weapon )

😔 No documentation found.

public DamageInfo( float damage, GameObject attacker, GameObject weapon, Hitbox hitbox )

😔 No documentation found.