slideObject
SLIDE_OBJECT0x2FDFF4107B8C1147The GTA V native SLIDE_OBJECT of the OBJECT namespace, as LS:MP client scripts call it: the global function slideObject, in JavaScript and in Lua.
slideObject(
object: Object,
toX: number,
toY: number,
toZ: number,
speedX: number,
speedY: number,
speedZ: number,
collision: boolean
): booleanslideObject(
object: Object,
toX: number,
toY: number,
toZ: number,
speedX: number,
speedY: number,
speedZ: number,
collision: boolean
): booleanUsage
JavaScript
const result = slideObject(object, toX, toY, toZ, speedX, speedY, speedZ, collision);Lua
local result = slideObject(object, toX, toY, toZ, speedX, speedY, speedZ, collision)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
const result = slideObject(object, to, speed, collision);Lua · with vectors
local result = slideObject(object, to, speed, collision)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
object | Object | number | integer |
toX | float | number | number |
toY | float | number | number |
toZ | float | number | number |
speedX | float | number | number |
speedY | float | number | number |
speedZ | float | number | number |
collision | BOOL | boolean | boolean |
Returns
BOOL JavaScript boolean, Lua booleanNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns true if the object has finished moving.
If false, moves the object towards the specified X, Y and Z coordinates with the specified X, Y and Z speed.
See also: https://gtagmodding.com/opcode-database/opcode/034E/
Has to be looped until it returns true.
Reference
- Namespace
- Object OBJECT
- In the game
BOOL SLIDE_OBJECT(Object object, float toX, float toY, float toZ, float speedX, float speedY, float speedZ, BOOL collision)- Hash
0x2FDFF4107B8C1147