Garry's Mod Wiki

Entity:GetPos

Vector Entity:GetPos()

Description

Gets the position of entity in world.

Returns

1 Vector
The position of the entity.

Example

Utility command that would give you the position of the entity you are looking at.

concommand.Add( "entity_pos", function( ply ) local tr = ply:GetEyeTrace() if ( IsValid( tr.Entity ) ) then print( "Entity position:", tr.Entity:GetPos() ) else print( "Crosshair position:", tr.HitPos ) end end )

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 2
Generate Html 6
SaveChanges 9
Render Body 0
Render Sidebar 12