EntityClient

detachEntity

DETACH_ENTITY0x961AC54BF0613F5D

The GTA V native DETACH_ENTITY of the ENTITY namespace, as LS:MP client scripts call it: the global function detachEntity, in JavaScript and in Lua.

SignatureJavaScript
detachEntity(entity: Entity, dynamic: boolean, collision: boolean): void
SignatureLua
detachEntity(entity: Entity, dynamic: boolean, collision: boolean)

Usage

JavaScript
detachEntity(entity, dynamic, collision);
Lua
detachEntity(entity, dynamic, collision)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
dynamicBOOLbooleanboolean
collisionBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

If collision is set to true, both entities won't collide with the other until the distance between them is above 4 meters.
Set dynamic to true to keep velocity after dettaching

Reference

Namespace
Entity ENTITY
In the game
void DETACH_ENTITY(Entity entity, BOOL dynamic, BOOL collision)
Hash
0x961AC54BF0613F5D

Open in the interactive natives reference