Garry's Mod Wiki

util.LocalToWorld

  Vector util.LocalToWorld( Entity ent, Vector lpos, number bone = 0 )

Description

A convenience function around LocalToWorld-related functions.

If Entity:EntIndex returns 0, the function will return the passed lpos.

Arguments

1 Entity ent
The entity to take.
2 Vector lpos
A local space vector.
3 number bone = 0
Actually to be treated as the number corresponding to a specific PhysObj of the entity.

If that specific physics object is valid, then PhysObj:LocalToWorld is used.

Otherwise, Entity:LocalToWorld.

Returns

1 Vector
The correspondent worldspace vector.