Entity.LocalToWorld

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:LocalToWorld( Vector offset )
Description:
Converts the 'local position' (a vector offset from 0,0,0, where 0,0,0 is considered to be the entity's center) to a world position (the standard type of position, where 0,0,0 is the center of the map).
Returns: Vector
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.LocalToWorld]Entity.LocalToWorld [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThe following code can be used to get the generic center of an entity.
Used onNewerShared.png
Code
ent = ents.GetAll()[1]
print(ent:LocalToWorld(ent:OBBCenter()))
OutputThe generic center of the first entity.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox