ObjectClient

slideObject

SLIDE_OBJECT0x2FDFF4107B8C1147

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

SignatureJavaScript
slideObject(
  object: Object,
  toX: number,
  toY: number,
  toZ: number,
  speedX: number,
  speedY: number,
  speedZ: number,
  collision: boolean
): boolean
SignatureLua
slideObject(
  object: Object,
  toX: number,
  toY: number,
  toZ: number,
  speedX: number,
  speedY: number,
  speedZ: number,
  collision: boolean
): boolean

Usage

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

ParameterTypeJavaScriptLua
objectObjectnumberinteger
toXfloatnumbernumber
toYfloatnumbernumber
toZfloatnumbernumber
speedXfloatnumbernumber
speedYfloatnumbernumber
speedZfloatnumbernumber
collisionBOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Notes

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

Open in the interactive natives reference