Entity.WorldToLocal

From GMod Wiki

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



Examples

DescriptionPrints the distance from the entity to the map center
Used onNewerShared.png
Code
MsgN( ent:WorldToLocal( Vector( 0, 0, 0 ) ) ) --Change ent to your entity
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox