Garry's Mod Wiki

Entity:SetPos

Entity:SetPos( Vector position )

Description

Moves the entity to the specified position.

If the new position doesn't take effect right away, you can use Entity:SetupBones to force it to do so. This issue is especially common when trying to render the same entity twice or more in a single frame at different positions.
Entities with Entity:GetSolid of SOLID_BBOX will have their angles reset!
This will fail inside of predicted functions called during player movement processing. This includes WEAPON:PrimaryAttack and WEAPON:Think.

Issue Tracker: 2447
Some entities, such as ragdolls, will appear unaffected by this function in the next frame. Consider PhysObj:SetPos if necessary.

Arguments

1 Vector position
The position to move the entity to.

Example

Sets the player's position to (0, 0, 0)

Entity( 1 ):SetPos( Vector( 0, 0, 0 ) )
Output: The player is now located at Vector(0, 0, 0)

Page Links


Special Pages


Wikis

?

Render Time: 104ms

DB GetPage 60
Generate Html 8
SaveChanges (1) 23
Render Body 0
Render Sidebar 10