Entity.WorldToLocal
From GMod Wiki
| 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: |  | 
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.WorldToLocal]Entity.WorldToLocal [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] | 
	
Examples
| Description | Prints the distance from the entity to the map center | 
|---|---|
| Used on |  | 
| Code | MsgN( ent:WorldToLocal( Vector( 0, 0, 0 ) ) ) --Change ent to your entity | 
| Output | N/A | 
 
			
			