Garry's Mod Wiki

Revision Difference

Player:GetEyeTrace#519018

<function name="GetEyeTrace" parent="Player" type="classfunc"> <description> Returns a table with information of what the player is looking at. The results of this function are cached every frame. See also <page>Player:GetEyeTraceNoCursor</page> </description> <realm>Shared</realm> <rets> <ret name="" type="table">Trace information, see <page>TraceResult</page></ret>⤶ <ret name="" type="table">Trace information, see <page>Structures/TraceResult</page></ret>⤶ </rets> </function> <example> <description>Prints the entity the player is looking at.</description> <code>print( Entity( 1 ):GetEyeTrace().Entity )</code> <output>"Entity [0][worldspawn]" in console, if you aim at world.</output> </example>