createObjectBreakEffect
Fractures a streamed object into fragments cut from its own live geometry.
Syntax
break-effect|false createObjectBreakEffect(object theObject [, table options])Arguments
theObjectobjectStreamed object element.
optionstableoptionalOptional fragment, physics and presentation options.
Table keys
Fragments
fragmentsintoptionalHow many pieces the object is cut into.
forcefloatoptionalOutward impulse applied to the fragments.
randomnessfloatoptionalVariation in the cut and the impulse, 0 for uniform.
seedintoptionalFixes the cut. The same seed produces the same pieces, which is how two clients can match.
velocitytableoptionalExtra starting velocity as {x, y, z}, added on top of force.
Physics
gravityfloatoptionalGravity applied to the fragments.
bouncefloatoptionalHow much fragments rebound off surfaces.
dragfloatoptionalAir drag slowing the fragments.
lifetimeintoptionalHow long fragments live, in milliseconds.
Presentation
renderDistancefloatoptionalDistance beyond which fragments stop drawing.
hideOriginalbooloptionalHide the source object when it fractures.
disableOriginalCollisionbooloptionalDrop the source object's collision when it fractures.
Returns
A break-effect element, or false when the object is not streamed or has no valid static RenderWare geometry.
Ownership and lifecycle
A break effect belongs to the resource that created it and is removed when that resource stops. Fragment geometry is cached per model, so repeated fractures of the same model reuse the first computed cut until the cache is cleared.
- No breakable DFF, fracture metadata or custom asset is required. Fragments are generated at runtime and keep the source UV and material data.
- This is deliberately separate from breakObject, which keeps GTA's native break semantics and its DFF requirement.
- Cutting the mesh is cached per model, so the second object of the same model reuses the first one's geometry.
Example
local effect = createObjectBreakEffect(theObject, { fragments = 24, force = 4 })Where this comes from
Continue exploring
← Back to the Neon Lua API · How Object fracture effects works →