Entity.SetLocalVelocity

From GMod Wiki

Revision as of 21:27, 26 August 2011 by Microbe (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:SetLocalVelocity( Vector velocity )
Description:
Instantly changes the velocity of an entity in relation to the world.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetLocalVelocity]Entity.SetLocalVelocity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionMakes the entity move forward indefinately
Used onNewerShared.png
Code
local ent = ents.Create("prop_physics")
 
ent:SetModel( "models/props_interiors/BathTub01a.mdl" )
ent:SetMoveType(MOVETYPE_FLY)
ent:SetPos(Vector(0,0,0))
ent:SetLocalVelocity(ent:GetForward()*100) // This will make the entity move forward
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox