OnTrapHitStart - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Event called when the object reference is a trap and has started hitting a live target.

Syntax[edit | edit source]

Event OnTrapHitStart(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \
    float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)

Parameters[edit | edit source]

  • akTarget: The ObjectReference that this reference just hit.
  • afXVel: The X velocity for our reference when it hit.
  • afYVel: The Y velocity for our reference when it hit.
  • afZVel: The Z velocity for our reference when it hit.
  • afXPos: The X position of our reference when it hit.
  • afYPos: The Y position of our reference when it hit.
  • afZPos: The Z position of our reference when it hit.
  • aeMaterial: Opaque integer value denoting what material the trap is. Not intended to be meaningful to script, just to be passed to other native functions that may use it.
  • abInitialHit: True if this is the first time the trap has hit the target.
  • aeMotionType: The motion type for the trap.
    • Note: Currently there are several read-only properties in the ObjectReference source file that match this, but it will later be changed to an enum and the possible list of values reduced to something more meaningful.

Examples[edit | edit source]

Event OnTrapHitStart(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \
    float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)
  Debug.Trace("Ouch! We just started hitting " + akTarget)
endEvent

See Also[edit | edit source]