Skip to content

createObjectBreakEffect

Client-side

Available in Neon, not standard MTA

Fractures a streamed object into fragments cut from its own live geometry.

Syntax

break-effect|false createObjectBreakEffect(object theObject [, table options])

Arguments

theObjectobject

Streamed object element.

optionstableoptional

Optional fragment, physics and presentation options.

Table keys

Fragments

fragmentsintoptional

How many pieces the object is cut into.

forcefloatoptional

Outward impulse applied to the fragments.

randomnessfloatoptional

Variation in the cut and the impulse, 0 for uniform.

seedintoptional

Fixes the cut. The same seed produces the same pieces, which is how two clients can match.

velocitytableoptional

Extra starting velocity as {x, y, z}, added on top of force.

Physics

gravityfloatoptional

Gravity applied to the fragments.

bouncefloatoptional

How much fragments rebound off surfaces.

dragfloatoptional

Air drag slowing the fragments.

lifetimeintoptional

How long fragments live, in milliseconds.

Presentation

renderDistancefloatoptional

Distance beyond which fragments stop drawing.

hideOriginalbooloptional

Hide the source object when it fractures.

disableOriginalCollisionbooloptional

Drop 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.

Important behavior
  • 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

RELATED NEON APIS

Continue exploring

Read the system guide →