Vehicle.Velocity

From Liberty Unleashed Wiki
Revision as of 03:47, 24 September 2011 by Stormeus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Vehicle class member returns the velocity of the given vehicle.

Syntax

  1. Vector Vehicle.Velocity

Arguments

  • Velocity - This is the changed velocity for the vehicle as a Vector

Example

  1.  
  2. function getVelocityX( )
  3. {
  4. local vehicle = FindVehicle( 1 );
  5. local velocity = veh.Velocity;
  6. local velocityX = velocity.x;
  7. return velocityX;
  8. }
  9.  

This code will return the velocity of vehicle 1 along the X axis.

Notes

The function FindVehicle was used in this example. More information is available on the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox