Garry's Mod Wiki

Revision Difference

Entity_Callbacks#523910

<cat>Dev</cat> All possible callbacks for <page>Entity:AddCallback</page>. See also <page>ENTITY:CalcAbsolutePosition</page> and <page>ENTITY:RenderOverride</page>, which are hooks that work on any entity (not just SENTs). Callback | Description | ---------|------------| | OnAngleChange | Called whenever the entity angles change.<br/><br/>The arguments are:<br/>* <page>Entity</page> ent - Our entity with new angles<br/>* <page>Angle</page> ang - The new angles |⤶ | BuildBonePositions | Called whenever the bones are being built.<br/><br/>The arguments are:<br/>* <page>Entity</page> ent - Our entity<br/>* <page>number</page> numbones - The max amount of bones this entity has, same as calling <page>Entity:GetBoneCount</page> | | PhysicsCollide | Called when we collide with something else.<br/><br/>The arguments are:<br/>* <page>Entity</page> ent - Our entity<br/>* <page>table</page> data - The collision data. See <page>Structures/CollisionData</page> | | BuildFlexWeights | Called whenever the flexes are being built.<br/>The arguments are:<br/>* <page>Entity</page> ent - Our entity<br/>* <page>number</page> numFlexes - Number of flexes in the table<br/>* <page>table</page> data - A number-indexed table of flex values starting at index 0<br/><br/>Return the edited **data** table to apply any changes. |