ProcessTrapHit - ObjectReference

From Creation Kit
Jump to: navigation, search

Member of: ObjectReference Script

Tells this reference to handle getting hit by a trap, dealing the specified amount of damage and possibly applying a pushback force.


Function ProcessTrapHit(ObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, /
  float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger) native


  • akTrap: Which trap reference just hit this reference.
  • afDamage: How much damage to deal to this reference.
  • afPushback: How far back to push this reference.
  • afXVel: The impact vector's X coordinate.
  • afYVel: The impact vector's Y coordinate.
  • afZVel: The impact vector's Z coordinate.
  • afXPos: The impact point's X coordinate.
  • afYPos: The impact point's Y coordinate.
  • afZPos: The impact point's Z coordinate.
  • aeMaterial: Opaque integer value denoting what material the trap is. (Usually received via an OnTrapHit event)
  • afStagger: How much to stagger the target, 0.0-1.0.

Return Value



; Process a trap hit on the player with just a little bit of damage, and no pushback or stagger, with a position
; velocity, and material from somewhere else (probably OnTrapHit)
Game.GetPlayer().ProcessTrapHit(SpikeTrap, 1.0, 0.0, xvel, yvel, zvel, xpos, ypos, zpos, material, 0.0)

See Also