s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
DamageInfo
chevron_left Classes
class
DamageInfo

Constructors

functionsDamageInfo

Properties

data_objectAttackerdata_objectDamagedata_objectHitboxremove_circleIsExplosiondata_objectOrigindata_objectPositiondata_objectShapedata_objectTagsdata_objectWeapon
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.
class Sandbox .
Sandbox.Engine

build Constructors 1

DamageInfo ()

data_object Properties 9

Attacker
GameObject
Usually a player or Npc
Damage
float
Amount of damage this should do
Hitbox
Hitbox
The hitbox that we hit (if any)
IsExplosion
obsoletebool
True if this is explosive damage
Origin
Vector3
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.
Position
Vector3
The location of the damage on the hit object.
Shape
PhysicsShape
The physics shape that we hit (if any)
Tags
TagSet
Tags for this damage, allows you to enter and read different damage types etc
Weapon
GameObject
The weapon that did the damage, or a vehicle etc
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter