Don't click here unless you want to be banned.

LSL Wiki : llSetVehicleType

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawling22.us.archive.org
llSetVehicleType(integer type)

Defines an object as a vehicle.

Second Life has a built-in physics engine that allows objects to behave as if they are constrained by real-world physics. An object can be manipulated by scripted forces, but the relatively slow execution time of a script makes it hard to make a vehicle that moves well. Defining an object as a vehicle shortcuts the speed limitations of a script, and lets the object work more closely with the physics engine. In this way, an object's physical movement can be defined very well, and a controllable vehicle can be made. In order to define an object as a vehicle, it must be set as one of several available vehicle types.

This should be the first function called when setting up how a vehicle works, as it will define the starting parameters for the vehicle. There are several constants that can be used to define the type:

Constant Value Description
VEHICLE_TYPE_NONE 0 disable the vehicle
VEHICLE_TYPE_AIRPLANE 4 uses linear deflection for lift, no hover, and banking to turn
VEHICLE_TYPE_BALLOON 5 hover, and friction, but no deflection
VEHICLE_TYPE_BOAT 3 hovers over water with lots of friction and some angular deflection
VEHICLE_TYPE_CAR 2 another vehicle that bounces along the ground but needs motors to be driven from external controls or timer events
VEHICLE_TYPE_SLED 1 simple vehicle that bumps along the ground, and prefers movement along its local x-axis

Examples:
// Sets the vehicle type to a basic airplane
llSetVehicleType(VEHICLE_TYPE_AIRPLANE);

// Sets the vehicle type to none, so the object is no longer defined as a vehicle
llSetVehicleType(VEHICLE_TYPE_NONE);


vehicles | functions
Comments [Hide comments/form]
Attach a comment to this page: