Entity.GetLocalPos

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetLocalPos( )
Description:
Returns Entity's position relative to it's parent.
Returns: Vector
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetLocalPos]Entity.GetLocalPos [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis will print your local position
Used onNewerClient.png
Code
 
 print( LocalPlayer():GetLocalPos() )
 
OutputN/A


DescriptionThis will print an entitys position relative to you
Used onNewerShared.png
Code
 
 local ent = ents.Create("prop_physics")--Create a prop
 ent:SetModel("models/combine_helicopter/helicopter_bomb01.mdl")--Set it's model
 ent:SetParent(Entity(1))--Parent it to you
 ent:Spawn()
 print( ent:GetLocalPos() )
 
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox