Garry's Mod Wiki

Entity:LocalToWorld

  Vector Entity:LocalToWorld( Vector lpos )

Description

Translates a vector relative to the entity's coordinate system into a worldspace vector.

Arguments

1 Vector lpos
A local space vector.

Returns

1 Vector
The correspondent worldspace vector.

Example

Produces a worldspace vector 100 units in front of the position of the entity, taking into account the entity's angles.

return ent:LocalToWorld( Vector( 100, 0, 0 ) )