Entity.SetPos

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetPos( Vector pos )
Description:
Instantly sets the position of the entity to the position of the given vector.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetPos]Entity.SetPos [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the entity's position 32 units above the spot that the player is aiming to.
Used onNewerShared.png
Code
 
local trace = Player:GetEyeTraceNoCursor();
Entity:SetPos(trace.HitPos + trace.HitNormal * 32);
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox