util.GetPlayerTrace
From GMod Wiki
Revision as of 12:39, 25 February 2011 by Unrealomega (Talk | contribs)
Function | |
Syntax |
util.GetPlayerTrace( Player ply[, Vector dir] ) Where is this used? |
Description: | |
Utility function to quickly generate a trace table that starts at the players view position, and ends 16384 units along a specified direction (or the players aim vector if dir isn't provided. | |
Returns: | Table |
Part of Library: | Util |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Util.GetPlayerTrace]Util.GetPlayerTrace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Do a trace from the player, based on their aim vector. |
---|---|
Used on | |
Code | trace = util.GetPlayerTrace( player_obj) traceRes=util.TraceLine(trace) |
Output | N/A |
Description | Do a trace from the player, upwards. |
---|---|
Used on | |
Code | trace = util.GetPlayerTrace( player_obj, Vector(0,0,1) ) traceRes=util.TraceLine(trace) |
Output | N/A |