Garry's Mod Wiki

Garry's Mod Wiki

  table Player:GetEyeTrace()

Description

Returns a table with information of what the player is looking at.

The results of this function are cached clientside every frame.

Uses util.GetPlayerTrace internally and is therefore bound by its limits.

See also Player:GetEyeTraceNoCursor.

Returns

1 table with TraceResult structure
Trace information, see TraceResult structure.

Example

Prints the entity the player is looking at.

print( Entity( 1 ):GetEyeTrace().Entity )
Output: Entity [0][worldspawn] in console, if you aim at world.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...