applyForceToEntityCenterOfMass
APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS0x18FF00FC7EFF559EThe GTA V native APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS of the ENTITY namespace, as LS:MP client scripts call it: the global function applyForceToEntityCenterOfMass, in JavaScript and in Lua.
applyForceToEntityCenterOfMass(
entity: Entity,
forceType: number,
x: number,
y: number,
z: number,
p5: boolean,
isDirectionRel: boolean,
isForceRel: boolean,
p8: boolean
): voidapplyForceToEntityCenterOfMass(
entity: Entity,
forceType: integer,
x: number,
y: number,
z: number,
p5: boolean,
isDirectionRel: boolean,
isForceRel: boolean,
p8: boolean
)Usage
applyForceToEntityCenterOfMass(entity, forceType, x, y, z, p5, isDirectionRel, isForceRel, p8);applyForceToEntityCenterOfMass(entity, forceType, x, y, z, p5, isDirectionRel, isForceRel, p8)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
applyForceToEntityCenterOfMass(entity, forceType, pos, p5, isDirectionRel, isForceRel, p8);applyForceToEntityCenterOfMass(entity, forceType, pos, p5, isDirectionRel, isForceRel, p8)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
forceType | int | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
p5 | BOOL | boolean | boolean |
isDirectionRel | BOOL | boolean | boolean |
isForceRel | BOOL | boolean | boolean |
p8 | BOOL | boolean | boolean |
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.
Applies a force to the specified entity.
List of force types (p1):
public enum ForceType
{
MinForce = 0,
MaxForceRot = 1,
MinForce2 = 2,
MaxForceRot2 = 3,
ForceNoRot = 4,
ForceRotPlusForce = 5
}Research/documentation on the gtaforums can be found here https://gtaforums.com/topic/885669-precisely-define-object-physics/) and here https://gtaforums.com/topic/887362-apply-forces-and-momentums-to-entityobject/.
p6/relative - makes the xyz force not relative to world coords, but to something else
p7/highForce - setting false will make the force really low
Reference
- Namespace
- Entity ENTITY
- In the game
void APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(Entity entity, int forceType, float x, float y, float z, BOOL p5, BOOL isDirectionRel, BOOL isForceRel, BOOL p8)- Hash
0x18FF00FC7EFF559E