RampRumble - ObjectReference

Member of: ObjectReference Script

Intended as a quick way to cause some controller and camera rumble. Automatically tapers intensity of the effect based on players distance from the point of origin/calling reference.

SyntaxEdit

bool Function RampRumble(float power = 0.5, float duration = 0.25, float falloff = 1600.0)

ParametersEdit

  • power: How powerful this rumble is at the point of origin
    • Default: 0.5, which is the half intensity. Valid values are 0.001 - 1.0, with 1.0 being the most intense effect possible
  • duration: how long should the effect last?
    • Default: 0.25
  • falloff: Radius of the effect. Most intense at calling reference, tapers to nothing at falloff distance
    • Default: 1600

Return ValueEdit

Returns false if no rumble is applied. (Invalid parameter values are clamped and won't cause it to fail)

ExamplesEdit

; cause some intense camera/controller rumble originating from the marker, with a small radius
; send debug traces to let me know if any rumble was caused
if (!RumbleMarker.RampRumble(1.0, 0.25, 512))
     debug.trace("RampRumble() didn't cause any shake.  Player too far away?")
else
     debug.trace("player's world was rocked")
endif


; simple controller/camera shake
RumbleMarker.RampRumble()

See AlsoEdit