Skip to content

VehicleSnapshot

An immutable snapshot of one vehicle the server knows: where it is, how it moves, who sits in it, what shape it is in and what it looks like. vehicles.getById and vehicles.listAll return it, and vehicleSnapshotsUpdated carries the ones that changed.

type VehicleSnapshot = Readonly<{
vehicleId: number;
model: number;
origin: VehicleOrigin;
createdByGamemode: boolean;
position: Vector3;
rotation: Quaternion;
facingAngleDegrees: number;
velocity: Vector3;
angularVelocity: Vector3;
occupants: readonly VehicleOccupant[];
driverPlayerId: number | null;
simulationOwnerPlayerId: number | null;
interior: number;
virtualWorld: number;
isWrecked: boolean;
condition: VehicleCondition | null;
controls: VehicleControls;
appearance: VehicleAppearance;
sampledAtSessionMs: number | null;
}>;
Field Type Description
vehicleId number The vehicle’s network ID.
model number The vehicle model ID.
origin VehicleOrigin Whether your gamemode created it, it is one of the game’s parked cars, or it is traffic.
createdByGamemode boolean true for a vehicle your gamemode created with vehicles.create.
position Vector3 Where it is, in world coordinates.
rotation Quaternion Its full rotation.
facingAngleDegrees number The way it faces on the map, 0 to 360.
velocity Vector3 How fast it moves, in m/s, in world coordinates.
angularVelocity Vector3 How fast it spins about each world axis, in rad/s.
occupants readonly VehicleOccupant[] The players in it, by seat. Seat 0 is the driver’s.
driverPlayerId number | null The player driving it, or null.
simulationOwnerPlayerId number | null The player whose game runs it now, or null while no player is near it.
interior number The interior it is in.
virtualWorld number The virtual world it is in.
isWrecked boolean Whether it has blown up.
condition VehicleCondition | null Health and damage, or null until a player’s game first reports it.
controls VehicleControls Engine, lights, lock, siren, windows and doors.
appearance VehicleAppearance What it looks like.
sampledAtSessionMs number | null When a player’s game last reported it, or null before the first report.