- Documentation
- Server functions
- setVehicleComponentTransform
Function
setVehicleComponentTransform
Stores the position, rotation and scale of a model part in one call. Each of the three arguments is a vector or a { x, y, z } table; an omitted one (nil) stays unchanged.
Syntax
bool setVehicleComponentTransform(vehicle vehicle, string component [, table position = nil, table rotation = nil, table scale = nil])Arguments
vehiclevehicle- The vehicle.
componentstring- Part name.
positiontable, optional = nil- Offset
{ x, y, z }in metres. rotationtable, optional = nil- Rotation
{ x, y, z }in degrees. scaletable, optional = nil- Scale
{ x, y, z }.
Returns
true on success.
Example
local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleComponentTransform(vehicle, "bonnet_dummy", { 0, 0, 0.1 }, { 30, 0, 0 }, nil)
Notes
State for scripts. The model does not change (see setVehicleComponentPosition).
See also
setVehicleComponentPositionStores an offset for a named part of a vehicle model (e.g. the bonnet) relative to its position in the model.setVehicleComponentRotationStores a rotation for a named part of a vehicle model in degrees (x, y, z).setVehicleComponentScaleStores a scale for a named part of a vehicle model on three axes (1 = original size).