Entity.SetVelocity

From GMod Wiki

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



Examples

DescriptionSets the Velocity of a player, similar to PhysObj.ApplyForceCenter.
Used onNewerShared.png
Code
function SWEP:PrimaryAttack()
 
      self.Owner:SetVelocity(self.Owner:GetForward() * 500 + Vector(0,0,1000))
 
end
OutputPunches the player forward and upwards.


Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox