Garry's Mod Wiki

Garry's Mod Wiki

  Vector Entity:GetVelocity()

Description

Returns the entity's velocity.

This returns the total velocity of the entity and is equal to local velocity + base velocity.

Clientside the velocity may be estimated for certain entities, such as physics based entities, instead of returning the "real" velocity from the server.

This can become out-of-sync on the client if the server has been up for a long time.

Issue Tracker: 774

Returns

1 Vector
The velocity of the entity.

Example

Lets you know if the object is being moved.

if ent:GetVelocity():LengthSqr() > 0 then // Is being moved else // Not being moved end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...