LeroY

Get vehicle size

Recommended Posts

How to get size of vehicle?

Start_x, End_x and sum dist and height?

Get position components or ... ?

Share this post


Link to post
function getVehicleSize(vehicle)
	if vehicle and isElement(vehicle) and getElementType(vehicle) == 'vehicle' then
		local minX,minY,minZ,maxX,maxY,maxZ = getElementBoundingBox(vehicle)
		return maxX-minX,maxY-minY,maxZ-minZ
	end
end

This returns the length, width, and height of the vehicle. Since it is 3d, you have 3 things to worry about.

Edited by ShayF

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.