setObjectBreakProfile
Gives an object durability so ordinary GTA damage fractures it on its own.
Syntax
bool setObjectBreakProfile(object theObject [, table options])Arguments
theObjectobjectStreamed object element.
optionstableoptionalDurability keys health, native, damageMultiplier and instantBreakThreshold, plus any fracture option.
Table keys
Durability
healthfloatoptionalDurability consumed by native GTA object damage. The object fractures at zero.
nativebooloptionalWhether GTA's native break path stays in play alongside the managed profile.
damageMultiplierfloatoptionalScales incoming native damage before it is subtracted from health.
instantBreakThresholdfloatoptionalA single hit above this value fractures the object outright.
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
true when the profile was applied; false for an invalid object or options.
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.
- Neon consumes GTA's native per-impact object damage. The fracture happens when health reaches zero, or when one hit exceeds instantBreakThreshold.
- This lets an ordinary runtime model break under gunfire without the DFF breakable plugin.
Example
setObjectBreakProfile(theObject, { health = 500, instantBreakThreshold = 200 })Where this comes from
Continue exploring
← Back to the Neon Lua API · How Object fracture effects works →