Entity.GetVelocity

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetVelocity( )
Description:
Retrieves the velocity of an entity.
Returns: Vector
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetVelocity]Entity.GetVelocity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionLets you know if the object is being moved.
Used onNewerServer.png
Code
 
//always do a isvalid check!!
if ent:IsValid() then
	if ent:GetVelocity():Length() > 0 then
		//is being rotated
	else
		//not being rotated
	end
end
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox