Skip to content

Object fracture effects

GTA has breakable objects, but only the ones Rockstar prepared: the model needs the DFF breakable plugin, and MTA’s breakObject only works on that fixed set.

Neon fractures any streamed object. Fragments are generated from the object’s live RenderWare geometry at runtime, so no custom DFF, TXD, shader or fracture metadata is involved, and the pieces keep the source UV and material data.

The clip runs test-resources/break-showcase. The props are ordinary GTA models with no breakable plugin.

Fracture it now, explicitly:

local effect = createObjectBreakEffect(theObject, {
fragments = 24,
force = 4,
randomness = 0.8,
})

Or arm the object and let normal damage do it. setObjectBreakProfile gives an object durability, and Neon consumes GTA’s native per-impact object damage until it runs out:

setObjectBreakProfile(theObject, {
health = 500,
instantBreakThreshold = 200, -- one big hit breaks it outright
fragments = 24,
})

Then shoot it, ram it, blow it up. When health reaches zero, or a single hit exceeds the threshold, the fracture happens on its own.

This is deliberately separate from breakObject. The legacy function keeps GTA’s native break semantics and its DFF requirement; a profiled object uses ordinary runtime geometry instead.

Both functions accept the same fracture options, and profiles add durability ones.

GroupKeys
Durabilityhealth, native, damageMultiplier, instantBreakThreshold
Fragmentsfragments, force, randomness, seed, velocity
Physicsgravity, bounce, drag, lifetime
PresentationrenderDistance, hideOriginal, disableOriginalCollision

seed makes a fracture reproducible: the same seed cuts the same pieces, which matters if two clients should see a prop break the same way.

createObjectBreakEffect returns a break-effect element you can inspect and pause.

FunctionReturns
getBreakEffectFragmentCountHow many pieces the object became
getBreakEffectSourceTriangleCountTriangles in the source mesh it was cut from
getBreakEffectSleepingFragmentCountPieces that have settled and stopped simulating
getBreakEffectCacheHitWhether this fracture reused cached geometry
isBreakEffectPaused / setBreakEffectPausedFreeze the debris mid-air

The sleeping count is the useful one for performance: fragments stop costing simulation once they settle.

Cutting a mesh into fragments is the expensive part, so Neon caches the result per model. Breaking the second crate of the same model reuses the first one’s computed geometry, which getBreakEffectCacheHit reports.

getBreakEffectCacheSize reports how many entries are held and clearBreakEffectCache drops them, which is worth doing after a scene that fractured many different models.

FunctionPurpose
setObjectBreakProfile / getObjectBreakProfile / clearObjectBreakProfileArm, inspect and disarm an object
getObjectBreakHealth / setObjectBreakHealth / resetObjectBreakHealthRead, set and restore remaining durability
  • Client-side only. No server element and no synchronization. Two clients fracturing the same prop need the same seed to see the same pieces, and the resource has to relay it.
  • The object must be streamed in and carry valid static RenderWare geometry. Fracturing something that is not streamed fails with a warning rather than silently doing nothing.
  • Effects belong to the resource that created them and are removed when it stops.
  • This does not replace breakObject, which keeps GTA’s native semantics for models that ship the breakable plugin.

test-resources/break-test runs /breaktest all and covers fracture creation from streamed geometry, managed element identity, fragment and triangle introspection, pause state, deterministic cache reuse, durability profiles, invalid arguments, several simultaneous effects and cleanup. The profile case specifically covers arming an object, health get/set/reset, profile introspection and the zero-health transition into a fracture.

test-resources/break-showcase has both the recorded runway sequence and an interactive playground: /breakspawn <model> health=500 fragments=24 force=4 spawns any GTA model, grounds it, arms it, and lets you shoot it. Neither resource is auto-deployed; copy them into the server resources directory first.

Implementation: 418f250d6.