Presets
Built-in effects that are registered when MotionFX loads. They are written entirely with the public primitives, so they also serve as examples for building your own.
MotionFX:Play(FX.Impact.Shake)
MotionFX:Play("Concussion", { Intensity = 0.7 })
Params
Every preset has a sound by default. Pass Params to adjust it:
| Param | Type | Description |
|---|---|---|
Sound | boolean | false plays the preset without sound. |
SoundId | string | Uses a different sound asset. |
Volume | number | Sound volume. Default 0.8. |
Direction | Vector3 | Explosion only. A camera-space push direction. Vector3.new(0, 0, 1) pushes the camera backwards. |
MotionFX:Play(FX.Impact.Explosion, {
Params = { Direction = Vector3.new(0, 0, 1), Volume = 1 },
})
Impact
| Preset | Retrigger | Length | Primitives |
|---|---|---|---|
Shake | Stack (max 4) | ≈ 0.52 s | Rotation, Position, Sound |
Earthquake | Refresh | 6 s | Rotation, Position, Sound |
Explosion | Stack (max 3) | ≈ 1.6 s | Rotation, Position, FOV, Blur, Color, Sound |
Recoil | Stack (max 3) | ≈ 0.27 s | Position, FOV, Rotation, Sound |
Shake
A short, sharp jolt: high-frequency noise on rotation and position under a 0.02 s attack and 0.5 s release. Several shakes can stack.
local envelope = Drive.Envelope({ Attack = 0.02, Release = 0.5 })
Tracks = {
{ Primitive = "Rotation", Driver = Drive.Modulate(Drive.Noise({ Frequency = 18, Amplitude = Vector3.new(1.2, 1.2, 2.5) }), envelope) },
{ Primitive = "Position", Driver = Drive.Modulate(Drive.Noise({ Frequency = 22, Amplitude = Vector3.new(0.15, 0.15, 0) }), envelope) },
}
Earthquake
Slow, heavy rumbling that builds over 1.2 s, holds for 3 s and dies away over 1.8 s. Its sound fades out with the shaking. Playing it again restarts the quake.
Explosion
A violent shake plus an FOV punch (spring, kick 7), a blur flash to 14, and a brightened, desaturated colour flash. With Params.Direction, a positional spring also pushes the camera along that vector.
Recoil
A weapon kick. The camera moves back, the FOV punches, and the camera pitches up with a small random yaw on each shot. All three are stiff springs, so rapid fire stacks naturally.
Injury
| Preset | Retrigger | Length | Primitives |
|---|---|---|---|
Blood | Refresh | ≈ 2.35 s | Vignette ×2, Color, Rotation, Sound |
Concussion | Refresh | ≈ 3.7 s | Blur, FOV, Rotation, Color, Vignette, Sound |
BrainDamage | Ignore | 10 s | Rotation, FOV, Blur, Color ×2, Vignette ×2, Sound |
Blood
A dark edge vignette with a deep red ring inside it, a red tint and a small roll. It flashes in over 0.05 s, holds for 0.9 s and fades over 1.4 s.
Concussion
A heavy blur (20) that clears over 3 s, a narrowing FOV spring, a slow drunken sway, washed-out colour and a vignette. Ear ringing fades in, starts 0.8 s into the audio, and fades out at the end.
BrainDamage
A sustained, disorienting state. It drifts violet → orange → blue, swings between washed-out and oversaturated, and has a breathing coloured ring inside a dark vignette, plus wandering rotation, FOV and blur. It fades in over 1.5 s and out over 2 s.
-- Lasts 10 s by default; override, stop early, or drive its strength
local handle = MotionFX:Play(FX.Injury.BrainDamage, { Duration = 30 })
handle:SetIntensity(0.4, 2)
handle:Stop()
Overriding a preset
Presets are ordinary registry entries. Replace one with your own definition:
MotionFX:Create("Shake", myShake, { Overwrite = true })